pub struct PrefixedString(pub String);Expand description
A UTF-8 string prefixed by its byte length as a VarInt.
The protocol limits both the UTF-8 payload size and the number of UTF-16 code units. Supplementary Unicode scalar values count as two UTF-16 code units. The general protocol limit is 32,767 UTF-16 code units and three UTF-8 bytes per permitted code unit; a particular field may impose a lower limit.
Tuple Fields§
§0: StringThe string value.
Implementations§
Trait Implementations§
Source§impl Clone for PrefixedString
impl Clone for PrefixedString
Source§fn clone(&self) -> PrefixedString
fn clone(&self) -> PrefixedString
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrefixedString
impl Debug for PrefixedString
Source§impl Default for PrefixedString
impl Default for PrefixedString
Source§fn default() -> PrefixedString
fn default() -> PrefixedString
Returns the “default value” for a type. Read more
impl Eq for PrefixedString
Source§impl Hash for PrefixedString
impl Hash for PrefixedString
Source§impl PartialEq for PrefixedString
impl PartialEq for PrefixedString
impl StructuralPartialEq for PrefixedString
Auto Trait Implementations§
impl Freeze for PrefixedString
impl RefUnwindSafe for PrefixedString
impl Send for PrefixedString
impl Sync for PrefixedString
impl Unpin for PrefixedString
impl UnsafeUnpin for PrefixedString
impl UnwindSafe for PrefixedString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ContextualCodec for Twhere
T: TypeCodec,
impl<T> ContextualCodec for Twhere
T: TypeCodec,
Source§fn encode_with_context(
&self,
writer: &mut impl Write,
_context: &Context,
) -> Result<(), CodecError>
fn encode_with_context( &self, writer: &mut impl Write, _context: &Context, ) -> Result<(), CodecError>
Encodes this value using context supplied by its enclosing structure.
Source§fn decode_with_context(
reader: &mut impl Read,
_context: &Context,
) -> Result<T, CodecError>where
T: Sized,
fn decode_with_context(
reader: &mut impl Read,
_context: &Context,
) -> Result<T, CodecError>where
T: Sized,
Decodes this value using context supplied by its enclosing structure.