Skip to main content

ConnectedSingleConnection

Struct ConnectedSingleConnection 

Source
pub struct ConnectedSingleConnection<I, O, C: Decoder<Item = I> + Encoder<O>> {
    pub source: SingleConnectionSource<I, C>,
    pub sink: SingleConnectionSink<O, C>,
}
Expand description

A connected implementation which only allows a single live connection for the lifetime of the server. The first accepted connection is kept and its sink and stream are exposed; any subsequent connections are ignored.

Fields§

§source: SingleConnectionSource<I, C>§sink: SingleConnectionSink<O, C>

Trait Implementations§

Source§

impl<I: 'static, O: Send + Sync + 'static, C: Decoder<Item = I> + Encoder<O> + Send + Sync + Default + 'static> Connected for ConnectedSingleConnection<I, O, C>

Source§

fn from_defn(pipe: Connection) -> Self

Auto Trait Implementations§

§

impl<I, O, C> Freeze for ConnectedSingleConnection<I, O, C>

§

impl<I, O, C> !RefUnwindSafe for ConnectedSingleConnection<I, O, C>

§

impl<I, O, C> Send for ConnectedSingleConnection<I, O, C>

§

impl<I, O, C> Sync for ConnectedSingleConnection<I, O, C>

§

impl<I, O, C> Unpin for ConnectedSingleConnection<I, O, C>

§

impl<I, O, C> UnsafeUnpin for ConnectedSingleConnection<I, O, C>

§

impl<I, O, C> !UnwindSafe for ConnectedSingleConnection<I, O, C>

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
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.

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.

§

impl<T> ToSinkBuild for T

§

fn iter_to_sink_build(self) -> SendIterBuild<Self>
where Self: Sized + Iterator,

Starts a [SinkBuild] adaptor chain to send all items from self as an Iterator.
§

fn stream_to_sink_build(self) -> SendStreamBuild<Self>
where Self: Sized + Stream,

Starts a [SinkBuild] adaptor chain to send all items from self as a [Stream].
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.