ByteRead

Trait ByteRead 

Source
pub trait ByteRead: Sized {
    // Required method
    async fn read<R: AsyncRead + Unpin + ?Sized>(
        reader: &mut R,
    ) -> Result<Self, Error>;
}
Expand description

Deserializes a type from raw bytes, reading it from an AsyncRead asynchronously.

Required Methods§

Source

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Deserializes bytes into an instance of this type by reading bytes from a reader.

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 ByteRead for SocketAddr

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for bool

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for char

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for i64

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for u8

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for u16

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for u32

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for u64

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for ()

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>(_: &mut R) -> Result<Self, Error>

Source§

impl ByteRead for String

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for Ipv4Addr

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for Ipv6Addr

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for SocketAddrV4

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for SocketAddrV6

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl ByteRead for Error

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl<T0: ByteRead, T1: ByteRead> ByteRead for (T0, T1)

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl<T0: ByteRead, T1: ByteRead, T2: ByteRead> ByteRead for (T0, T1, T2)

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl<T0: ByteRead, T1: ByteRead, T2: ByteRead, T3: ByteRead> ByteRead for (T0, T1, T2, T3)

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl<T0: ByteRead, T1: ByteRead, T2: ByteRead, T3: ByteRead, T4: ByteRead> ByteRead for (T0, T1, T2, T3, T4)

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl<T: ByteRead> ByteRead for Option<T>

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl<T: ByteRead> ByteRead for Vec<T>

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Source§

impl<T: ByteRead, E: ByteRead> ByteRead for Result<T, E>

Source§

async fn read<R: AsyncRead + Unpin + ?Sized>( reader: &mut R, ) -> Result<Self, Error>

Implementors§

Source§

impl ByteRead for EventData

Source§

impl ByteRead for AddUserResponse

Source§

impl ByteRead for DeleteUserResponse

Source§

impl ByteRead for EventStreamConfigResponse

Source§

impl ByteRead for RemoveSocketResponse

Source§

impl ByteRead for SandstormCommandType

Source§

impl ByteRead for SandstormHandshakeStatus

Source§

impl ByteRead for UpdateUserResponse

Source§

impl ByteRead for AuthMethod

Source§

impl ByteRead for SocksRequestAddress

Source§

impl ByteRead for UserRole

Source§

impl ByteRead for UsersLoadingError

Source§

impl ByteRead for Event

Source§

impl ByteRead for AddSandstormSocketRequest

Source§

impl ByteRead for AddSandstormSocketResponse

Source§

impl ByteRead for AddSocks5SocketRequest

Source§

impl ByteRead for AddSocks5SocketResponse

Source§

impl ByteRead for AddUserRequest

Source§

impl ByteRead for CurrentMetricsRequest

Source§

impl ByteRead for CurrentMetricsResponse

Source§

impl ByteRead for DeleteUserRequest

Source§

impl ByteRead for EventStreamConfigRequest

Source§

impl ByteRead for EventStreamResponse

Source§

impl ByteRead for GetBufferSizeRequest

Source§

impl ByteRead for GetBufferSizeResponse

Source§

impl ByteRead for ListAuthMethodsRequest

Source§

impl ByteRead for ListAuthMethodsResponse

Source§

impl ByteRead for ListSandstormSocketsRequest

Source§

impl ByteRead for ListSandstormSocketsResponse

Source§

impl ByteRead for ListSocks5SocketsRequest

Source§

impl ByteRead for ListSocks5SocketsResponse

Source§

impl ByteRead for ListUsersRequest

Source§

impl ByteRead for ListUsersResponse

Source§

impl ByteRead for MeowRequest

Source§

impl ByteRead for MeowResponse

Source§

impl ByteRead for Metrics

Source§

impl ByteRead for RemoveSandstormSocketRequest

Source§

impl ByteRead for RemoveSandstormSocketResponse

Source§

impl ByteRead for RemoveSocks5SocketRequest

Source§

impl ByteRead for RemoveSocks5SocketResponse

Source§

impl ByteRead for SandstormHandshake

Source§

impl ByteRead for SetBufferSizeRequest

Source§

impl ByteRead for SetBufferSizeResponse

Source§

impl ByteRead for ShutdownRequest

Source§

impl ByteRead for ShutdownResponse

Source§

impl ByteRead for ToggleAuthMethodRequest

Source§

impl ByteRead for ToggleAuthMethodResponse

Source§

impl ByteRead for UpdateUserRequest

Source§

impl ByteRead for SocksRequest

Source§

impl ByteRead for SmallReadString

Source§

impl<T: ByteRead> ByteRead for SmallReadList<T>