[][src]Struct assembly_data::fdb::common::Latin1String

#[repr(transparent)]pub struct Latin1String { /* fields omitted */ }

An owned latin-1 encoded string

Implementations

impl Latin1String[src]

pub unsafe fn new(inner: Box<[u8]>) -> Self[src]

Create a new string

Safety

Must not contain null bytes

pub fn encode(string: &str) -> Cow<'_, Latin1Str>[src]

Create a new instance from a rust string.

Note: This encodes any unavailable unicode codepoints as their equivalent HTML-Entity. This is an implementation detail of the encoding_rs crate and not really useful for this crate.

Methods from Deref<Target = Latin1Str>

pub fn as_bytes(&self) -> &[u8][src]

Get the bytes of the string

pub fn len(&self) -> usize[src]

Get the bytes of the string

pub fn is_empty(&self) -> bool[src]

Check whether the str is empty

pub fn req_buf_len(&self) -> usize[src]

Calculates the number of 4-byte units that are needed to store this string with at least one null terminator.

pub fn decode(&self) -> Cow<'_, str>[src]

Decode the string

Trait Implementations

impl Borrow<Latin1Str> for Latin1String[src]

impl Deref for Latin1String[src]

type Target = Latin1Str

The resulting type after dereferencing.

impl Eq for Latin1String[src]

impl<'_> From<&'_ Latin1Str> for Latin1String[src]

impl<'_> From<Cow<'_, Latin1Str>> for Latin1String[src]

impl Ord for Latin1String[src]

impl PartialEq<Latin1String> for Latin1String[src]

impl PartialOrd<Latin1String> for Latin1String[src]

impl StructuralEq for Latin1String[src]

impl StructuralPartialEq for Latin1String[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.