pub enum EncodedString<'a> {
Utf8(&'a str),
Utf16Be(Utf16BeStr<'a>),
Utf16Le(Utf16LeStr<'a>),
}
Expand description
A string encoded as either UTF-8, UTF-16-BE or UTF-16-LE.
Variants§
Utf8(&'a str)
A UTF-8 encoded string.
Utf16Be(Utf16BeStr<'a>)
A UTF-16-BE encoded string.
Utf16Le(Utf16LeStr<'a>)
A UTF-16-LE encoded string.
Implementations§
Source§impl<'a> EncodedString<'a>
impl<'a> EncodedString<'a>
Sourcepub fn create(text: &'a str) -> EncodedString<'a>
pub fn create(text: &'a str) -> EncodedString<'a>
Creates a UTF-8 encoded string.
Sourcepub fn create_utf16_be(
text: &str,
buffer: &'a mut [u8],
) -> Result<EncodedString<'a>, SerializeError>
pub fn create_utf16_be( text: &str, buffer: &'a mut [u8], ) -> Result<EncodedString<'a>, SerializeError>
Creates a UTF-16-BE encoded string.
Sourcepub fn create_utf16_le(
text: &str,
buffer: &'a mut [u8],
) -> Result<EncodedString<'a>, SerializeError>
pub fn create_utf16_le( text: &str, buffer: &'a mut [u8], ) -> Result<EncodedString<'a>, SerializeError>
Creates a UTF-16-LE encoded string.
Trait Implementations§
Source§impl<'a> Clone for EncodedString<'a>
impl<'a> Clone for EncodedString<'a>
Source§fn clone(&self) -> EncodedString<'a>
fn clone(&self) -> EncodedString<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for EncodedString<'a>
impl<'a> Debug for EncodedString<'a>
Source§impl<'a> Parse<'a> for EncodedString<'a>
impl<'a> Parse<'a> for EncodedString<'a>
Source§fn parse_partial(
reader: &mut ByteReader<'a>,
) -> Result<EncodedString<'a>, ParseError>
fn parse_partial( reader: &mut ByteReader<'a>, ) -> Result<EncodedString<'a>, ParseError>
Parses a SOME/IP payload type from a given slice of bytes. Read more
Source§impl<'a> PartialEq for EncodedString<'a>
impl<'a> PartialEq for EncodedString<'a>
Source§impl Serialize for EncodedString<'_>
impl Serialize for EncodedString<'_>
Source§fn required_length(&self) -> usize
fn required_length(&self) -> usize
Returns the number of bytes required to store the serialized version of self.
Source§fn serialize_partial(
&self,
byte_writer: &mut ByteWriter<'_>,
) -> Result<(), SerializeError>
fn serialize_partial( &self, byte_writer: &mut ByteWriter<'_>, ) -> Result<(), SerializeError>
Serializes to a byte writer.
impl<'a> Eq for EncodedString<'a>
impl<'a> StructuralPartialEq for EncodedString<'a>
Auto Trait Implementations§
impl<'a> Freeze for EncodedString<'a>
impl<'a> RefUnwindSafe for EncodedString<'a>
impl<'a> Send for EncodedString<'a>
impl<'a> Sync for EncodedString<'a>
impl<'a> Unpin for EncodedString<'a>
impl<'a> UnwindSafe for EncodedString<'a>
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