Struct cakerabbit_core::Utf8String [−][src]
pub struct Utf8String { /* fields omitted */ }Expand description
Represents an UTF-8 MessagePack string type.
According to the MessagePack spec, string objects may contain invalid byte sequence and the behavior of a deserializer depends on the actual implementation when it received invalid byte sequence. Deserializers should provide functionality to get the original byte array so that applications can decide how to handle the object.
Summarizing, it’s prohibited to instantiate a string type with invalid UTF-8 sequences, however
it is possible to obtain an underlying bytes that were attempted to convert to a String. This
may happen when trying to unpack strings that were decoded using older MessagePack spec with
raw types instead of string/binary.
Implementations
Returns the string reference if the string is valid UTF-8, or else None.
Returns the underlying Utf8Error if the string contains invalud UTF-8 sequence, or
else None.
Consumes this object, yielding the string if the string is valid UTF-8, or else None.
Converts a Utf8String into a byte vector.
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl RefUnwindSafe for Utf8String
impl Send for Utf8String
impl Sync for Utf8String
impl Unpin for Utf8String
impl UnwindSafe for Utf8String
Blanket Implementations
Mutably borrows from an owned value. Read more