Struct ServiceBuilder

Source
pub struct ServiceBuilder<St, C, Io, Codec> { /* private fields */ }

Implementations§

Source§

impl<St, C, Io, Codec> ServiceBuilder<St, C, Io, Codec>
where St: Clone, C: Service<Request = Connect<Io, Codec>, Response = ConnectResult<Io, St, Codec>>, Io: AsyncRead + AsyncWrite, Codec: Decoder + Encoder, <Codec as Encoder>::Item: 'static, <Codec as Encoder>::Error: Debug,

Source

pub fn disconnect<F, Out>(self, disconnect: F) -> Self
where F: Fn(St, bool) + 'static,

Callback to execute on disconnect

Second parameter indicates error occured during disconnect.

Source

pub fn finish<F, T>(self, service: F) -> FramedServiceImpl<St, C, T, Io, Codec>
where F: IntoServiceFactory<T>, T: ServiceFactory<Config = St, Request = Item<St, Codec>, Response = Option<<Codec as Encoder>::Item>, Error = C::Error, InitError = C::Error>,

Provide stream items handler service and construct service factory.

Auto Trait Implementations§

§

impl<St, C, Io, Codec> Freeze for ServiceBuilder<St, C, Io, Codec>
where C: Freeze,

§

impl<St, C, Io, Codec> !RefUnwindSafe for ServiceBuilder<St, C, Io, Codec>

§

impl<St, C, Io, Codec> !Send for ServiceBuilder<St, C, Io, Codec>

§

impl<St, C, Io, Codec> !Sync for ServiceBuilder<St, C, Io, Codec>

§

impl<St, C, Io, Codec> Unpin for ServiceBuilder<St, C, Io, Codec>
where C: Unpin, St: Unpin, Io: Unpin, Codec: Unpin,

§

impl<St, C, Io, Codec> !UnwindSafe for ServiceBuilder<St, C, Io, Codec>

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.

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