Struct xous::string::String

source ·
pub struct String<const N: usize> { /* private fields */ }

Implementations§

source§

impl<const N: usize> String<N>

source

pub fn new() -> String<N>

source

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

source

pub fn as_str(&self) -> Result<&str, Utf8Error>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn clear(&mut self)

Clear the contents of this String and set the length to 0

source

pub fn to_str(&self) -> &str

source

pub fn push(&mut self, ch: char) -> Result<usize, Error>

source

pub fn append(&mut self, s: &str) -> Result<usize, Error>

source

pub fn push_byte(&mut self, b: u8) -> Result<(), Error>

Trait Implementations§

source§

impl<const N: usize> AsRef<str> for String<N>

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<const N: usize> Clone for String<N>

source§

fn clone(&self) -> String<N>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<const N: usize> Debug for String<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const N: usize> Default for String<N>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<const N: usize> Display for String<N>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<const N: usize> FromStr for String<N>

§

type Err = &'static str

The associated error which can be returned from parsing.
source§

fn from_str(src: &str) -> Result<String<N>, &'static str>

Parses a string s to return a value of this type. Read more
source§

impl<const N: usize> PartialEq for String<N>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<const N: usize> Write for String<N>

source§

fn write_str(&mut self, s: &str) -> Result<(), Error>

Writes a string slice into this writer, returning whether the write succeeded. Read more
1.1.0 · source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more
source§

impl<const N: usize> Copy for String<N>

source§

impl<const N: usize> Eq for String<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for String<N>

§

impl<const N: usize> RefUnwindSafe for String<N>

§

impl<const N: usize> Send for String<N>

§

impl<const N: usize> Sync for String<N>

§

impl<const N: usize> Unpin for String<N>

§

impl<const N: usize> UnwindSafe for String<N>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.