Skip to main content

BridgeIo

Struct BridgeIo 

pub struct BridgeIo<Io1, Io2>(pub Io1, pub Io2);
Expand description

A bidirectional bridge between two Io objects.

Often this is for Client-Server communication, but in a P2P like topology it can also be equal nodes.

ExtensionsRef and ExtensionsMut is implemented in function of Io1 as it is assumed that in flows where BridgeIo is used that we keep moving from “left” (Io1) to “right” (Io2) until we start to actually relay bytes, handshakes or any kind of data.

If you ever use Io2’s extensions you can do so explicitly.

Tuple Fields§

§0: Io1§1: Io2

Trait Implementations§

§

impl<Io1, Io2> ExtensionsMut for BridgeIo<Io1, Io2>
where Io1: ExtensionsMut,

§

fn extensions_mut(&mut self) -> &mut Extensions

Get mutable reference to the underlying Extensions store
§

impl<Io1, Io2> ExtensionsRef for BridgeIo<Io1, Io2>
where Io1: ExtensionsRef,

§

fn extensions(&self) -> &Extensions

Get reference to the underlying Extensions store
§

impl<Ingress, Egress> PeekIoProvider for BridgeIo<Ingress, Egress>
where Ingress: Io, Egress: Io,

§

type PeekIo = Ingress

The type that can be peeked.
§

type Mapped<PeekedIngress: Io> = BridgeIo<PeekedIngress, Egress>

The mapped Self type produced as a result of mapping the PeekIo type.
§

fn peek_io_mut( &mut self, ) -> &mut <BridgeIo<Ingress, Egress> as PeekIoProvider>::PeekIo

Retrieve a mutable reference to the Peekable type.
§

fn map_peek_io<PeekedIngress, F>( self, map: F, ) -> <BridgeIo<Ingress, Egress> as PeekIoProvider>::Mapped<PeekedIngress>
where PeekedIngress: Io, F: FnOnce(<BridgeIo<Ingress, Egress> as PeekIoProvider>::PeekIo) -> PeekedIngress,

Once peeking is finished one can reproduce self by mapping the Peeked Io type and produce a new type, usually with the peeked data in-memory as prefix.
§

impl<Ingress, Egress, M> Service<BridgeIo<Ingress, Egress>> for HttpMitmRelay<M>

§

type Output = ()

The type of the output returned by the service.
§

type Error = Box<dyn Error + Send + Sync>

The type of error returned by the service.
§

async fn serve( &self, __arg1: BridgeIo<Ingress, Egress>, ) -> Result<<HttpMitmRelay<M> as Service<BridgeIo<Ingress, Egress>>>::Output, <HttpMitmRelay<M> as Service<BridgeIo<Ingress, Egress>>>::Error>

Serve an output or an error for the given input
§

fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>

Box this service to allow for dynamic dispatch.
§

impl<I, F, Ingress, Egress> Service<BridgeIo<Ingress, Egress>> for Socks5MitmRelayService<I, F>
where I: Service<BridgeIo<Ingress, Egress>, Output = ()>, <I as Service<BridgeIo<Ingress, Egress>>>::Error: Into<Box<dyn Error + Send + Sync>>, F: Service<BridgeIo<Ingress, Egress>, Output = ()>, <F as Service<BridgeIo<Ingress, Egress>>>::Error: Into<Box<dyn Error + Send + Sync>>, Ingress: Io + Unpin + ExtensionsMut, Egress: Io + Unpin + ExtensionsMut,

§

type Output = ()

The type of the output returned by the service.
§

type Error = Box<dyn Error + Send + Sync>

The type of error returned by the service.
§

async fn serve( &self, __arg1: BridgeIo<Ingress, Egress>, ) -> Result<<Socks5MitmRelayService<I, F> as Service<BridgeIo<Ingress, Egress>>>::Output, <Socks5MitmRelayService<I, F> as Service<BridgeIo<Ingress, Egress>>>::Error>

Serve an output or an error for the given input
§

fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>

Box this service to allow for dynamic dispatch.
§

impl<Issuer, Inner, Ingress, Egress> Service<BridgeIo<Ingress, Egress>> for TlsMitmRelayService<Issuer, Inner>
where Issuer: BoringMitmCertIssuer, <Issuer as BoringMitmCertIssuer>::Error: Into<Box<dyn Error + Send + Sync>>, Inner: Service<BridgeIo<TlsStream<Ingress>, TlsStream<Egress>>, Output = ()>, <Inner as Service<BridgeIo<TlsStream<Ingress>, TlsStream<Egress>>>>::Error: Into<Box<dyn Error + Send + Sync>>, Ingress: Io + Unpin + ExtensionsMut, Egress: Io + Unpin + ExtensionsMut,

§

type Output = ()

The type of the output returned by the service.
§

type Error = TlsMitmRelayError

The type of error returned by the service.
§

async fn serve( &self, input: BridgeIo<Ingress, Egress>, ) -> Result<<TlsMitmRelayService<Issuer, Inner> as Service<BridgeIo<Ingress, Egress>>>::Output, <TlsMitmRelayService<Issuer, Inner> as Service<BridgeIo<Ingress, Egress>>>::Error>

Serve an output or an error for the given input
§

fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>

Box this service to allow for dynamic dispatch.
§

impl<S, Ingress, Egress> Service<BridgeIo<Ingress, Egress>> for WebSocketRelayService<S>

§

type Output = ()

The type of the output returned by the service.
§

type Error = Infallible

The type of error returned by the service.
§

async fn serve( &self, __arg1: BridgeIo<Ingress, Egress>, ) -> Result<<WebSocketRelayService<S> as Service<BridgeIo<Ingress, Egress>>>::Output, <WebSocketRelayService<S> as Service<BridgeIo<Ingress, Egress>>>::Error>

Serve an output or an error for the given input
§

fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>

Box this service to allow for dynamic dispatch.
§

impl<S, T> Service<BridgeIo<S, T>> for IoForwardService
where S: Io + Unpin, T: Io + Unpin,

§

type Output = ()

The type of the output returned by the service.
§

type Error = Box<dyn Error + Send + Sync>

The type of error returned by the service.
§

async fn serve( &self, __arg1: BridgeIo<S, T>, ) -> Result<<IoForwardService as Service<BridgeIo<S, T>>>::Output, <IoForwardService as Service<BridgeIo<S, T>>>::Error>

Serve an output or an error for the given input
§

fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>

Box this service to allow for dynamic dispatch.

Auto Trait Implementations§

§

impl<Io1, Io2> Freeze for BridgeIo<Io1, Io2>
where Io1: Freeze, Io2: Freeze,

§

impl<Io1, Io2> RefUnwindSafe for BridgeIo<Io1, Io2>
where Io1: RefUnwindSafe, Io2: RefUnwindSafe,

§

impl<Io1, Io2> Send for BridgeIo<Io1, Io2>
where Io1: Send, Io2: Send,

§

impl<Io1, Io2> Sync for BridgeIo<Io1, Io2>
where Io1: Sync, Io2: Sync,

§

impl<Io1, Io2> Unpin for BridgeIo<Io1, Io2>
where Io1: Unpin, Io2: Unpin,

§

impl<Io1, Io2> UnsafeUnpin for BridgeIo<Io1, Io2>
where Io1: UnsafeUnpin, Io2: UnsafeUnpin,

§

impl<Io1, Io2> UnwindSafe for BridgeIo<Io1, Io2>
where Io1: UnwindSafe, Io2: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a rama_grpc::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
§

impl<T, U> RamaFrom<T> for U
where U: From<T>,

§

fn rama_from(value: T) -> U

§

impl<T, U, CrateMarker> RamaInto<U, CrateMarker> for T
where U: RamaFrom<T, CrateMarker>,

§

fn rama_into(self) -> U

§

impl<T, U> RamaTryFrom<T> for U
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

§

fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>

§

impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for T
where U: RamaTryFrom<T, CrateMarker>,

§

type Error = <U as RamaTryFrom<T, CrateMarker>>::Error

§

fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more