Struct transmog_async::Builder

source ·
pub struct Builder<TReads, TWrites, TStream, TFormat> { /* private fields */ }
Expand description

Builder helper to specify types without the need of turbofishing.

Implementations§

source§

impl<TStream, TFormat> Builder<(), (), TStream, TFormat>

source

pub fn new(stream: TStream, format: TFormat) -> Self

Returns a new stream builder for stream and format.

source§

impl<TStream, TFormat> Builder<(), (), TStream, TFormat>

source

pub fn sends_and_receives<T>(self) -> Builder<T, T, TStream, TFormat>where TFormat: Format<'static, T>,

Sets T as the type for both sending and receiving.

source§

impl<TReads, TStream, TFormat> Builder<TReads, (), TStream, TFormat>

source

pub fn sends<T>(self) -> Builder<TReads, T, TStream, TFormat>where TFormat: Format<'static, T>,

Sets T as the type of data that is written to this stream.

source§

impl<TWrites, TStream, TFormat> Builder<(), TWrites, TStream, TFormat>

source

pub fn receives<T>(self) -> Builder<T, TWrites, TStream, TFormat>where TFormat: Format<'static, T>,

Sets T as the type of data that is read from this stream.

source§

impl<TReads, TWrites, TStream, TFormat> Builder<TReads, TWrites, TStream, TFormat>where TFormat: Clone,

source

pub fn for_async( self ) -> TransmogStream<TReads, TWrites, TStream, AsyncDestination, TFormat>

Build this stream to include the serialized data’s size before each serialized value.

This is necessary for compatability with a remote TransmogReader.

source

pub fn for_sync( self ) -> TransmogStream<TReads, TWrites, TStream, SyncDestination, TFormat>

Build this stream only send Transmog-encoded values.

This is necessary for compatability with stock Transmog receivers.

Auto Trait Implementations§

§

impl<TReads, TWrites, TStream, TFormat> RefUnwindSafe for Builder<TReads, TWrites, TStream, TFormat>where TFormat: RefUnwindSafe, TReads: RefUnwindSafe, TStream: RefUnwindSafe, TWrites: RefUnwindSafe,

§

impl<TReads, TWrites, TStream, TFormat> Send for Builder<TReads, TWrites, TStream, TFormat>where TFormat: Send, TReads: Send, TStream: Send, TWrites: Send,

§

impl<TReads, TWrites, TStream, TFormat> Sync for Builder<TReads, TWrites, TStream, TFormat>where TFormat: Sync, TReads: Sync, TStream: Sync, TWrites: Sync,

§

impl<TReads, TWrites, TStream, TFormat> Unpin for Builder<TReads, TWrites, TStream, TFormat>where TFormat: Unpin, TReads: Unpin, TStream: Unpin, TWrites: Unpin,

§

impl<TReads, TWrites, TStream, TFormat> UnwindSafe for Builder<TReads, TWrites, TStream, TFormat>where TFormat: UnwindSafe, TReads: UnwindSafe, TStream: UnwindSafe, TWrites: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.