Struct data_rw::Data [−][src]
pub struct Data { /* fields omitted */ }Implementations
获取OFFSET
设置OFFSET
写入变成U16
写入变成U32
写入变成U64
写入变长i64
写入变长i32
写入变长i64
写入二进制变长长度
写入二进制定长长度 u32 le
写入二进制定长长度 u32
写入字符串变长长度
写入字符串定长长度 u32 le
写入字符串定长长度 u32
读取二进制 U32 LE
读取字符串 U32 LE
获取二进制 定长 u32
获取字符串 定长u32
Trait Implementations
Returns the number of bytes between the current position and the end of the buffer. Read more
Returns a slice starting at the current position and of length between 0
and Buf::remaining(). Note that this can return shorter slice (this allows
non-continuous internal representation). Read more
Fills dst with potentially multiple slices starting at self’s
current position. Read more
Returns true if there are any more bytes to consume Read more
Gets an unsigned 16 bit integer from self in big-endian byte order. Read more
Gets an unsigned 16 bit integer from self in little-endian byte order. Read more
Gets a signed 16 bit integer from self in big-endian byte order. Read more
Gets a signed 16 bit integer from self in little-endian byte order. Read more
Gets an unsigned 32 bit integer from self in the big-endian byte order. Read more
Gets an unsigned 32 bit integer from self in the little-endian byte order. Read more
Gets a signed 32 bit integer from self in big-endian byte order. Read more
Gets a signed 32 bit integer from self in little-endian byte order. Read more
Gets an unsigned 64 bit integer from self in big-endian byte order. Read more
Gets an unsigned 64 bit integer from self in little-endian byte order. Read more
Gets a signed 64 bit integer from self in big-endian byte order. Read more
Gets a signed 64 bit integer from self in little-endian byte order. Read more
Gets an unsigned 128 bit integer from self in big-endian byte order. Read more
Gets an unsigned 128 bit integer from self in little-endian byte order. Read more
Gets a signed 128 bit integer from self in big-endian byte order. Read more
Gets a signed 128 bit integer from self in little-endian byte order. Read more
Gets an unsigned n-byte integer from self in big-endian byte order. Read more
Gets an unsigned n-byte integer from self in little-endian byte order. Read more
Gets a signed n-byte integer from self in big-endian byte order. Read more
Gets a signed n-byte integer from self in little-endian byte order. Read more
Gets an IEEE754 single-precision (4 bytes) floating point number from
self in big-endian byte order. Read more
Gets an IEEE754 single-precision (4 bytes) floating point number from
self in little-endian byte order. Read more
Gets an IEEE754 double-precision (8 bytes) floating point number from
self in big-endian byte order. Read more
Gets an IEEE754 double-precision (8 bytes) floating point number from
self in little-endian byte order. Read more
Consumes len bytes inside self and returns new instance of Bytes
with this data. Read more
Creates an adaptor which will read at most limit bytes from self. Read more
Creates an adaptor which will chain this buffer with another. Read more
Returns the number of bytes that can be written from the current position until the end of the buffer is reached. Read more
Advance the internal cursor of the BufMut Read more
Returns a mutable slice starting at the current BufMut position and of
length between 0 and BufMut::remaining_mut(). Note that this can be shorter than the
whole remainder of the buffer (this allows non-continuous implementation). Read more
Returns true if there is space in self for more bytes. Read more
Transfer bytes into self from src and advance the cursor by the
number of bytes written. Read more
Transfer bytes into self from src and advance the cursor by the
number of bytes written. Read more
Writes an unsigned 16 bit integer to self in big-endian byte order. Read more
Writes an unsigned 16 bit integer to self in little-endian byte order. Read more
Writes a signed 16 bit integer to self in big-endian byte order. Read more
Writes a signed 16 bit integer to self in little-endian byte order. Read more
Writes an unsigned 32 bit integer to self in big-endian byte order. Read more
Writes an unsigned 32 bit integer to self in little-endian byte order. Read more
Writes a signed 32 bit integer to self in big-endian byte order. Read more
Writes a signed 32 bit integer to self in little-endian byte order. Read more
Writes an unsigned 64 bit integer to self in the big-endian byte order. Read more
Writes an unsigned 64 bit integer to self in little-endian byte order. Read more
Writes a signed 64 bit integer to self in the big-endian byte order. Read more
Writes a signed 64 bit integer to self in little-endian byte order. Read more
Writes an unsigned 128 bit integer to self in the big-endian byte order. Read more
Writes an unsigned 128 bit integer to self in little-endian byte order. Read more
Writes a signed 128 bit integer to self in the big-endian byte order. Read more
Writes a signed 128 bit integer to self in little-endian byte order. Read more
Writes an unsigned n-byte integer to self in big-endian byte order. Read more
Writes an unsigned n-byte integer to self in the little-endian byte order. Read more
Writes a signed n-byte integer to self in big-endian byte order. Read more
Writes a signed n-byte integer to self in little-endian byte order. Read more
Writes an IEEE754 single-precision (4 bytes) floating point number to
self in big-endian byte order. Read more
Writes an IEEE754 single-precision (4 bytes) floating point number to
self in little-endian byte order. Read more
Writes an IEEE754 double-precision (8 bytes) floating point number to
self in big-endian byte order. Read more
Writes an IEEE754 double-precision (8 bytes) floating point number to
self in little-endian byte order. Read more
Creates an adaptor which can write at most limit bytes to self. Read more
Creates an adaptor which implements the Write trait for self. Read more
type Error = DataError
type Error = DataErrorThe error type that can be returned if some error occurs during deserialization. Read more
Require the Deserializer to figure out how to drive the visitor based
on what data type is in the input. Read more
Hint that the Deserialize type is expecting a bool value.
Hint that the Deserialize type is expecting an i8 value.
Hint that the Deserialize type is expecting a u8 value.
Hint that the Deserialize type is expecting an i16 value.
Hint that the Deserialize type is expecting a u16 value.
Hint that the Deserialize type is expecting an i32 value.
Hint that the Deserialize type is expecting a u32 value.
Hint that the Deserialize type is expecting an i64 value.
Hint that the Deserialize type is expecting a u64 value.
Hint that the Deserialize type is expecting a f32 value.
Hint that the Deserialize type is expecting a f64 value.
Hint that the Deserialize type is expecting a char value.
Hint that the Deserialize type is expecting a string value and does
not benefit from taking ownership of buffered data owned by the
Deserializer. Read more
Hint that the Deserialize type is expecting a string value and would
benefit from taking ownership of buffered data owned by the
Deserializer. Read more
Hint that the Deserialize type is expecting a byte array and does not
benefit from taking ownership of buffered data owned by the
Deserializer. Read more
Hint that the Deserialize type is expecting a byte array and would
benefit from taking ownership of buffered data owned by the
Deserializer. Read more
Hint that the Deserialize type is expecting an optional value. Read more
Hint that the Deserialize type is expecting a unit value.
Hint that the Deserialize type is expecting a unit struct with a
particular name. Read more
Hint that the Deserialize type is expecting a newtype struct with a
particular name. Read more
Hint that the Deserialize type is expecting a sequence of values.
Hint that the Deserialize type is expecting a sequence of values and
knows how many values there are without looking at the serialized data. Read more
Hint that the Deserialize type is expecting a tuple struct with a
particular name and number of fields. Read more
Hint that the Deserialize type is expecting a map of key-value pairs.
Hint that the Deserialize type is expecting a struct with a particular
name and fields. Read more
Hint that the Deserialize type is expecting an enum value with a
particular name and possible variants. Read more
Hint that the Deserialize type is expecting the name of a struct
field or the discriminant of an enum variant. Read more
Hint that the Deserialize type needs to deserialize a value whose type
doesn’t matter because it is ignored. Read more
Hint that the Deserialize type is expecting an i128 value. Read more
Hint that the Deserialize type is expecting an u128 value. Read more
Determine whether Deserialize implementations should expect to
deserialize their human-readable form. Read more
Performs the conversion.
The output type produced by this Serializer during successful
serialization. Most serializers that produce text or binary output
should set Ok = () and serialize into an io::Write or buffer
contained within the Serializer instance. Serializers that build
in-memory data structures may be simplified by using Ok to propagate
the data structure around. Read more
type Error = DataError
type Error = DataErrorThe error type when some error occurs during serialization.
type SerializeSeq = DataSerializeSeq<'a>
type SerializeSeq = DataSerializeSeq<'a>Type returned from serialize_seq for serializing the content of the
sequence. Read more
type SerializeTuple = DataSerializeTuple<'a>
type SerializeTuple = DataSerializeTuple<'a>Type returned from serialize_tuple for serializing the content of
the tuple. Read more
type SerializeTupleStruct = DataSerializeTupleStruct<'a>
type SerializeTupleStruct = DataSerializeTupleStruct<'a>Type returned from serialize_tuple_struct for serializing the
content of the tuple struct. Read more
type SerializeTupleVariant = DataSerializeTupleVariant<'a>
type SerializeTupleVariant = DataSerializeTupleVariant<'a>Type returned from serialize_tuple_variant for serializing the
content of the tuple variant. Read more
type SerializeMap = DataSerializeMap<'a>
type SerializeMap = DataSerializeMap<'a>Type returned from serialize_map for serializing the content of the
map. Read more
type SerializeStruct = DataSerializeTupleStruct<'a>
type SerializeStruct = DataSerializeTupleStruct<'a>Type returned from serialize_struct for serializing the content of
the struct. Read more
type SerializeStructVariant = DataSerializeTupleVariant<'a>
type SerializeStructVariant = DataSerializeTupleVariant<'a>Type returned from serialize_struct_variant for serializing the
content of the struct variant. Read more
Serialize a bool value. Read more
Serialize an i16 value. Read more
Serialize an i32 value. Read more
Serialize an i64 value. Read more
Serialize a u16 value. Read more
Serialize a u32 value. Read more
Serialize a u64 value. Read more
Serialize an f32 value. Read more
Serialize an f64 value. Read more
Serialize a character. Read more
Serialize a chunk of raw byte data. Read more
Serialize a unit struct like struct Unit or PhantomData<T>. Read more
Serialize a unit variant like E::A in enum E { A, B }. Read more
Serialize a newtype struct like struct Millimeters(u8). Read more
Serialize a newtype variant like E::N in enum E { N(u8) }. Read more
Begin to serialize a variably sized sequence. This call must be
followed by zero or more calls to serialize_element, then a call to
end. Read more
Begin to serialize a statically sized sequence whose length will be
known at deserialization time without looking at the serialized data.
This call must be followed by zero or more calls to serialize_element,
then a call to end. Read more
fn serialize_tuple_struct(
self,
_name: &'static str,
len: usize
) -> Result<Self::SerializeTupleStruct, Self::Error>
fn serialize_tuple_struct(
self,
_name: &'static str,
len: usize
) -> Result<Self::SerializeTupleStruct, Self::Error>Begin to serialize a tuple struct like struct Rgb(u8, u8, u8). This
call must be followed by zero or more calls to serialize_field, then a
call to end. Read more
fn serialize_tuple_variant(
self,
_name: &'static str,
_variant_index: u32,
variant: &'static str,
len: usize
) -> Result<Self::SerializeTupleVariant, Self::Error>
fn serialize_tuple_variant(
self,
_name: &'static str,
_variant_index: u32,
variant: &'static str,
len: usize
) -> Result<Self::SerializeTupleVariant, Self::Error>Begin to serialize a tuple variant like E::T in enum E { T(u8, u8) }. This call must be followed by zero or more calls to
serialize_field, then a call to end. Read more
Begin to serialize a map. This call must be followed by zero or more
calls to serialize_key and serialize_value, then a call to end. Read more
fn serialize_struct(
self,
_name: &'static str,
len: usize
) -> Result<Self::SerializeStruct, Self::Error>
fn serialize_struct(
self,
_name: &'static str,
len: usize
) -> Result<Self::SerializeStruct, Self::Error>Begin to serialize a struct like struct Rgb { r: u8, g: u8, b: u8 }.
This call must be followed by zero or more calls to serialize_field,
then a call to end. Read more
fn serialize_struct_variant(
self,
_name: &'static str,
_variant_index: u32,
variant: &'static str,
len: usize
) -> Result<Self::SerializeStructVariant, Self::Error>
fn serialize_struct_variant(
self,
_name: &'static str,
_variant_index: u32,
variant: &'static str,
len: usize
) -> Result<Self::SerializeStructVariant, Self::Error>Begin to serialize a struct variant like E::S in enum E { S { r: u8, g: u8, b: u8 } }. This call must be followed by zero or more calls to
serialize_field, then a call to end. Read more
Serialize a string produced by an implementation of Display. Read more
Serialize an i128 value. Read more
Serialize a u128 value. Read more
fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Serialize,
fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Serialize, Collect an iterator as a sequence. Read more
fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
K: Serialize,
V: Serialize,
I: IntoIterator<Item = (K, V)>,
fn collect_map<K, V, I>(self, iter: I) -> Result<Self::Ok, Self::Error> where
K: Serialize,
V: Serialize,
I: IntoIterator<Item = (K, V)>, Collect an iterator as a map. Read more
Determine whether Serialize implementations should serialize in
human-readable form. Read more
Auto Trait Implementations
impl RefUnwindSafe for Dataimpl UnwindSafe for DataBlanket Implementations
Mutably borrows from an owned value. Read more