Struct rmp_serde::Raw [] [src]

pub struct Raw { /* fields omitted */ }

Helper that allows both to encode and decode strings no matter whether they contain valid or invalid UTF-8.

Regardless of validity the UTF-8 content this type will always be serialized as a string.

Methods

impl Raw
[src]

[src]

Constructs a new Raw from the UTF-8 string.

[src]

Converts a vector of bytes to a Raw.

[src]

Returns true if the raw is valid UTF-8.

[src]

Returns true if the raw contains invalid UTF-8 sequence.

[src]

Returns the string reference if the raw is valid UTF-8, or else None.

[src]

Returns the underlying Utf8Error if the raw contains invalid UTF-8 sequence, or else None.

[src]

Returns a byte slice of this raw's contents.

[src]

Consumes this object, yielding the string if the raw is valid UTF-8, or else None.

[src]

Converts a Raw into a byte vector.

Trait Implementations

impl Clone for Raw
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Raw
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for Raw
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Serialize for Raw
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for Raw
[src]

[src]

Deserialize this value from the given Serde deserializer. Read more