Struct 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> Freeze for Builder<TReads, TWrites, TStream, TFormat>
where TStream: Freeze, TFormat: Freeze,

§

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

§

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

§

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

§

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

§

impl<TReads, TWrites, TStream, TFormat> UnwindSafe for Builder<TReads, TWrites, TStream, TFormat>
where TStream: UnwindSafe, TFormat: UnwindSafe, TReads: UnwindSafe, TWrites: 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
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, 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.