Trait stdto_core::ToBytes

source ·
pub trait ToBytes: Serialize {
    const OPTIONS: ToBytesOptions = _;
Show 32 methods fn try_to_be_bytes(&self) -> Result<Vec<u8>> { ... } fn try_to_le_bytes(&self) -> Result<Vec<u8>> { ... } fn try_to_ne_bytes(&self) -> Result<Vec<u8>> { ... } fn try_to_be_bytes_into(&self, writer: impl Write) -> Result<()> { ... } fn try_to_le_bytes_into(&self, writer: impl Write) -> Result<()> { ... } fn try_to_ne_bytes_into(&self, writer: impl Write) -> Result<()> { ... } fn to_be_bytes(&self) -> Vec<u8> { ... } fn to_le_bytes(&self) -> Vec<u8> { ... } fn to_ne_bytes(&self) -> Vec<u8> { ... } fn to_be_bytes_into(&self, writer: impl Write) { ... } fn to_le_bytes_into(&self, writer: impl Write) { ... } fn to_ne_bytes_into(&self, writer: impl Write) { ... } fn try_from_be_bytes<'a>(bytes: &'a [u8]) -> Result<Self>
    where
        Self: Deserialize<'a>
, { ... } fn try_from_le_bytes<'a>(bytes: &'a [u8]) -> Result<Self>
    where
        Self: Deserialize<'a>
, { ... } fn try_from_ne_bytes<'a>(bytes: &'a [u8]) -> Result<Self>
    where
        Self: Deserialize<'a>
, { ... } fn try_from_be_bytes_from(reader: impl Read) -> Result<Self>
    where
        Self: DeserializeOwned
, { ... } fn try_from_le_bytes_from(reader: impl Read) -> Result<Self>
    where
        Self: DeserializeOwned
, { ... } fn try_from_ne_bytes_from(reader: impl Read) -> Result<Self>
    where
        Self: DeserializeOwned
, { ... } fn from_be_bytes<'a>(bytes: &'a [u8]) -> Self
    where
        Self: Deserialize<'a>
, { ... } fn from_le_bytes<'a>(bytes: &'a [u8]) -> Self
    where
        Self: Deserialize<'a>
, { ... } fn from_ne_bytes<'a>(bytes: &'a [u8]) -> Self
    where
        Self: Deserialize<'a>
, { ... } fn from_be_bytes_from(reader: impl Read) -> Self
    where
        Self: DeserializeOwned
, { ... } fn from_le_bytes_from(reader: impl Read) -> Self
    where
        Self: DeserializeOwned
, { ... } fn from_ne_bytes_from(reader: impl Read) -> Self
    where
        Self: DeserializeOwned
, { ... } fn try_to_bytes(&self) -> Result<Vec<u8>> { ... } fn try_to_bytes_into(&self, writer: impl Write) -> Result<()> { ... } fn try_from_bytes<'a>(bytes: &'a [u8]) -> Result<Self>
    where
        Self: Deserialize<'a>
, { ... } fn try_from_bytes_from(reader: impl Read) -> Result<Self>
    where
        Self: DeserializeOwned
, { ... } fn to_bytes(&self) -> Vec<u8> { ... } fn to_bytes_into(&self, writer: impl Write) { ... } fn from_bytes<'a>(bytes: &'a [u8]) -> Self
    where
        Self: Deserialize<'a>
, { ... } fn from_bytes_from(reader: impl Read) -> Self
    where
        Self: DeserializeOwned
, { ... }
}
Expand description

Provided Associated Constants§

Provided Methods§

Serialize to bytes.

Deserialize from bytes.

Implementors§