Skip to main content

FixedSize

Trait FixedSize 

Source
pub trait FixedSize: Sized + Send {
    // Required methods
    fn read_from<'life0, 'async_trait, R>(
        reader: &'life0 mut R,
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where R: 'async_trait + AsyncRead + Unpin + Send,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn write_to<'life0, 'async_trait, W>(
        self,
        writer: &'life0 mut W,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where W: 'async_trait + AsyncWrite + Unpin + Send,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for types that can be read/written as fixed-size values

Required Methods§

Source

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Reads a fixed-size value from the given async reader.

Source

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Writes this fixed-size value to the given async writer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FixedSize for f32

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for f64

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for i8

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for i16

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for i32

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for i64

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for i128

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for u8

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for u16

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for u32

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for u64

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

impl FixedSize for u128

Source§

fn read_from<'life0, 'async_trait, R>( reader: &'life0 mut R, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where R: 'async_trait + AsyncRead + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Source§

fn write_to<'life0, 'async_trait, W>( self, writer: &'life0 mut W, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait,

Implementors§