Struct bincode::config::WithOtherEndian
source · [−]pub struct WithOtherEndian<O: Options, E: BincodeByteOrder> { /* private fields */ }
Expand description
A configuration struct with a user-specified endian order
Trait Implementations
sourceimpl<O: Clone + Options, E: Clone + BincodeByteOrder> Clone for WithOtherEndian<O, E>
impl<O: Clone + Options, E: Clone + BincodeByteOrder> Clone for WithOtherEndian<O, E>
sourcefn clone(&self) -> WithOtherEndian<O, E>
fn clone(&self) -> WithOtherEndian<O, E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<O: Copy + Options, E: Copy + BincodeByteOrder> Copy for WithOtherEndian<O, E>
Auto Trait Implementations
impl<O, E> RefUnwindSafe for WithOtherEndian<O, E> where
E: RefUnwindSafe,
O: RefUnwindSafe,
impl<O, E> Send for WithOtherEndian<O, E> where
E: Send,
O: Send,
impl<O, E> Sync for WithOtherEndian<O, E> where
E: Sync,
O: Sync,
impl<O, E> Unpin for WithOtherEndian<O, E> where
E: Unpin,
O: Unpin,
impl<O, E> UnwindSafe for WithOtherEndian<O, E> where
E: UnwindSafe,
O: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Options for T where
T: InternalOptions,
impl<T> Options for T where
T: InternalOptions,
sourcefn with_no_limit(self) -> WithOtherLimit<Self, Infinite>
fn with_no_limit(self) -> WithOtherLimit<Self, Infinite>
Sets the byte limit to be unlimited. This is the default. Read more
sourcefn with_limit(self, limit: u64) -> WithOtherLimit<Self, Bounded>
fn with_limit(self, limit: u64) -> WithOtherLimit<Self, Bounded>
Sets the byte limit to limit
.
sourcefn with_little_endian(self) -> WithOtherEndian<Self, LittleEndian>
fn with_little_endian(self) -> WithOtherEndian<Self, LittleEndian>
Sets the endianness to little-endian This is the default. Read more
sourcefn with_big_endian(self) -> WithOtherEndian<Self, BigEndian>
fn with_big_endian(self) -> WithOtherEndian<Self, BigEndian>
Sets the endianness to big-endian
sourcefn with_native_endian(self) -> WithOtherEndian<Self, NativeEndian>
fn with_native_endian(self) -> WithOtherEndian<Self, NativeEndian>
Sets the endianness to the the machine-native endianness
sourcefn with_varint_encoding(self) -> WithOtherIntEncoding<Self, VarintEncoding>
fn with_varint_encoding(self) -> WithOtherIntEncoding<Self, VarintEncoding>
Sets the length encoding to varint
sourcefn with_fixint_encoding(self) -> WithOtherIntEncoding<Self, FixintEncoding>
fn with_fixint_encoding(self) -> WithOtherIntEncoding<Self, FixintEncoding>
Sets the length encoding to be fixed
sourcefn reject_trailing_bytes(self) -> WithOtherTrailing<Self, RejectTrailing>
fn reject_trailing_bytes(self) -> WithOtherTrailing<Self, RejectTrailing>
Sets the deserializer to reject trailing bytes
sourcefn allow_trailing_bytes(self) -> WithOtherTrailing<Self, AllowTrailing>
fn allow_trailing_bytes(self) -> WithOtherTrailing<Self, AllowTrailing>
Sets the deserializer to allow trailing bytes
sourcefn serialize<S: ?Sized + Serialize>(self, t: &S) -> Result<Vec<u8>>
fn serialize<S: ?Sized + Serialize>(self, t: &S) -> Result<Vec<u8>>
Serializes a serializable object into a Vec
of bytes using this configuration
sourcefn serialized_size<T: ?Sized + Serialize>(self, t: &T) -> Result<u64>
fn serialized_size<T: ?Sized + Serialize>(self, t: &T) -> Result<u64>
Returns the size that an object would be if serialized using Bincode with this configuration
sourcefn serialize_into<W: Write, T: ?Sized + Serialize>(
self,
w: W,
t: &T
) -> Result<()>
fn serialize_into<W: Write, T: ?Sized + Serialize>(
self,
w: W,
t: &T
) -> Result<()>
Serializes an object directly into a Writer
using this configuration Read more
sourcefn deserialize<'a, T: Deserialize<'a>>(self, bytes: &'a [u8]) -> Result<T>
fn deserialize<'a, T: Deserialize<'a>>(self, bytes: &'a [u8]) -> Result<T>
Deserializes a slice of bytes into an instance of T
using this configuration
sourcefn deserialize_seed<'a, T: DeserializeSeed<'a>>(
self,
seed: T,
bytes: &'a [u8]
) -> Result<T::Value>
fn deserialize_seed<'a, T: DeserializeSeed<'a>>(
self,
seed: T,
bytes: &'a [u8]
) -> Result<T::Value>
Deserializes a slice of bytes with state seed
using this configuration.
sourcefn deserialize_from<R: Read, T: DeserializeOwned>(self, reader: R) -> Result<T>
fn deserialize_from<R: Read, T: DeserializeOwned>(self, reader: R) -> Result<T>
Deserializes an object directly from a Read
er using this configuration Read more
sourcefn deserialize_from_seed<'a, R: Read, T: DeserializeSeed<'a>>(
self,
seed: T,
reader: R
) -> Result<T::Value>
fn deserialize_from_seed<'a, R: Read, T: DeserializeSeed<'a>>(
self,
seed: T,
reader: R
) -> Result<T::Value>
Deserializes an object directly from a Read
er with state seed
using this configuration Read more
sourcefn deserialize_from_custom<'a, R: BincodeRead<'a>, T: DeserializeOwned>(
self,
reader: R
) -> Result<T>
fn deserialize_from_custom<'a, R: BincodeRead<'a>, T: DeserializeOwned>(
self,
reader: R
) -> Result<T>
Deserializes an object from a custom BincodeRead
er using the default configuration.
It is highly recommended to use deserialize_from
unless you need to implement
BincodeRead
for performance reasons. Read more
sourcefn deserialize_from_custom_seed<'a, R: BincodeRead<'a>, T: DeserializeSeed<'a>>(
self,
seed: T,
reader: R
) -> Result<T::Value>
fn deserialize_from_custom_seed<'a, R: BincodeRead<'a>, T: DeserializeSeed<'a>>(
self,
seed: T,
reader: R
) -> Result<T::Value>
Deserializes an object from a custom BincodeRead
er with state seed
using the default
configuration. It is highly recommended to use deserialize_from
unless you need to
implement BincodeRead
for performance reasons. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more