pub trait ToBytes: Serialize {
const OPTIONS: ToBytesOptions = ToBytesOptions{ endian: Endian::Little,};
Show 32 methods
fn try_to_be_bytes(&self) -> Result<Vec<u8, Global>, Error> { ... }
fn try_to_le_bytes(&self) -> Result<Vec<u8, Global>, Error> { ... }
fn try_to_ne_bytes(&self) -> Result<Vec<u8, Global>, Error> { ... }
fn try_to_be_bytes_into(&self, writer: impl Write) -> Result<(), Error> { ... }
fn try_to_le_bytes_into(&self, writer: impl Write) -> Result<(), Error> { ... }
fn try_to_ne_bytes_into(&self, writer: impl Write) -> Result<(), Error> { ... }
fn to_be_bytes(&self) -> Vec<u8, Global> { ... }
fn to_le_bytes(&self) -> Vec<u8, Global> { ... }
fn to_ne_bytes(&self) -> Vec<u8, Global> { ... }
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, Error>
where
Self: Deserialize<'a>,
{ ... }
fn try_from_le_bytes<'a>(bytes: &'a [u8]) -> Result<Self, Error>
where
Self: Deserialize<'a>,
{ ... }
fn try_from_ne_bytes<'a>(bytes: &'a [u8]) -> Result<Self, Error>
where
Self: Deserialize<'a>,
{ ... }
fn try_from_be_bytes_from(reader: impl Read) -> Result<Self, Error>
where
Self: DeserializeOwned,
{ ... }
fn try_from_le_bytes_from(reader: impl Read) -> Result<Self, Error>
where
Self: DeserializeOwned,
{ ... }
fn try_from_ne_bytes_from(reader: impl Read) -> Result<Self, Error>
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, Global>, Error> { ... }
fn try_to_bytes_into(&self, writer: impl Write) -> Result<(), Error> { ... }
fn try_from_bytes<'a>(bytes: &'a [u8]) -> Result<Self, Error>
where
Self: Deserialize<'a>,
{ ... }
fn try_from_bytes_from(reader: impl Read) -> Result<Self, Error>
where
Self: DeserializeOwned,
{ ... }
fn to_bytes(&self) -> Vec<u8, Global> { ... }
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,
{ ... }
}Provided Associated Constants§
const OPTIONS: ToBytesOptions = ToBytesOptions{ endian: Endian::Little,}
Provided Methods§
fn try_to_le_bytes(&self) -> Result<Vec<u8, Global>, Error>
fn try_to_ne_bytes(&self) -> Result<Vec<u8, Global>, Error>
fn try_to_be_bytes_into(&self, writer: impl Write) -> Result<(), Error>
fn try_to_le_bytes_into(&self, writer: impl Write) -> Result<(), Error>
fn try_to_ne_bytes_into(&self, writer: impl Write) -> Result<(), Error>
fn to_be_bytes(&self) -> Vec<u8, Global>
fn to_le_bytes(&self) -> Vec<u8, Global>
fn to_ne_bytes(&self) -> Vec<u8, Global>
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)
sourcefn try_from_be_bytes<'a>(bytes: &'a [u8]) -> Result<Self, Error>where
Self: Deserialize<'a>,
fn try_from_be_bytes<'a>(bytes: &'a [u8]) -> Result<Self, Error>where
Self: Deserialize<'a>,
Deserialize from bytes.