Wrapped

Struct Wrapped 

Source
#[repr(transparent)]
pub struct Wrapped<T, I>(pub T, _);

Tuple Fields§

§0: T

Implementations§

Source§

impl<T, I> Wrapped<T, I>

Source

pub fn new(value: T) -> Self

Trait Implementations§

Source§

impl<T, I> WireFormat for Wrapped<T, I>
where T: Send + AsRef<I>, I: WireFormat + Into<T>,

Available on non-WebAssembly only.
Source§

fn byte_size(&self) -> u32

Returns the number of bytes necessary to fully encode self.
Source§

fn encode<W: Write>(&self, writer: &mut W) -> Result<()>

Encodes self into writer.
Source§

fn decode<R: Read>(reader: &mut R) -> Result<Self>

Decodes Self from reader.

Auto Trait Implementations§

§

impl<T, I> Freeze for Wrapped<T, I>
where T: Freeze,

§

impl<T, I> RefUnwindSafe for Wrapped<T, I>

§

impl<T, I> Send for Wrapped<T, I>
where T: Send, I: Send,

§

impl<T, I> Sync for Wrapped<T, I>
where T: Sync, I: Sync,

§

impl<T, I> Unpin for Wrapped<T, I>
where T: Unpin, I: Unpin,

§

impl<T, I> UnwindSafe for Wrapped<T, I>
where T: UnwindSafe, I: 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> AsyncWireFormatExt for T
where T: WireFormat + Send,

Source§

fn encode_async<W>(self, writer: W) -> impl Future<Output = Result<()>>
where Self: Sync + Sized, W: AsyncWrite + Unpin + Send,

Encodes the object asynchronously into the provided writer. Read more
Source§

fn decode_async<R>(reader: R) -> impl Future<Output = Result<Self>> + Send
where Self: Sync + Sized, R: AsyncRead + Unpin + Send,

Decodes an object asynchronously from the provided reader. 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> ConvertWireFormat for T
where T: WireFormat,

Source§

fn to_bytes(&self) -> Bytes

Converts the type to bytes. Returns a Bytes object containing the encoded bytes.

Source§

fn from_bytes(buf: &Bytes) -> Result<T, Error>

Converts bytes to the type. Returns a Result containing the decoded type or an std::io::Error if decoding fails.

Source§

fn as_bytes(&self) -> Vec<u8>

AsRef<u8> for the type. 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.
§

impl<T> ErasedDestructor for T
where T: 'static,