Struct lib_ruby_parser::Bytes[][src]

#[repr(C)]
pub struct Bytes { pub raw: Vec<u8>, }
Expand description

Representation of a byte sequence, see BytesTrait for available methods

Fields

raw: Vec<u8>

Raw vector of bytes

Trait Implementations

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

Appends a byte

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

Clears inner data

Returns a copy of the value. Read more

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 !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

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.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.