#[repr(C)]
pub struct Bytes {
pub raw: Vec<u8>,
}
Expand description
Representation of a byte sequence, see BytesTrait
for available methods
Constructs Bytes based on a given vector
Returns a reference to inner data
“Unwraps” self and returns inner data
Replaces inner data with given list
Constructs an empty instance of Bytes
Converts byte sequence to a string slice, returns error if there are invalid UTF-8 chars
Converts byte sequnce to a string, all invalid UTF-8 chars are converted into “replacement char”
Converts byte sequence to a String, returns error if there are invalid UTF-8 chars
Consumes itself and convrters it into a string, returns error if there are invalid UTF-8 chars
Returns true
if self
represents a valid UTF-8 string
Returns true
if byte sequence is empty
Returns length of the byte sequence
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
The returned type after indexing.
Performs the indexing (container[index]
) operation. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
The type returned in the event of a conversion error.