Shared

Struct Mutable_string_type

Source
pub struct Mutable_string_type<'a, S = u32>
where S: Size_trait,
{ /* private fields */ }
Expand description

This structure is a safe wrapper for a mutable string slice from external pointers.

This is specifically designed to be used with foreign function interfaces.

Implementations§

Source§

impl<'a, S> Mutable_string_type<'a, S>
where S: Size_trait,

Source

pub unsafe fn From_unchecked( String: NonNull<u8>, Length: NonNull<S>, Size: S, ) -> Self

§Safety

This function is unsafe because it does not check if the buffer contains a valid UTF-8 string and if the length is valid.

Source

pub fn From( String: NonNull<u8>, Length: NonNull<S>, Size: S, ) -> Result<Self, Error_type>

Source

pub fn Equal(&self, String: &str) -> bool

Source

pub fn Concatenate(&mut self, String: &str) -> Result<(), Error_type>

Source

pub fn Clear(&mut self)

Source

pub fn Get_data(&'a mut self) -> &'a mut [u8]

Source

pub fn Get_length(&self) -> usize

Source

pub fn Get_size(&self) -> usize

Source

pub fn Get_characters(&self) -> Chars<'_>

Source

pub fn Get_characters_indices(&self) -> impl Iterator<Item = (usize, char)> + '_

Source

pub fn Get_lines(&'a self) -> Lines<'a>

Source

pub fn As_str(&self) -> &str

Trait Implementations§

Source§

impl<S> AddAssign<&str> for Mutable_string_type<'_, S>
where S: Size_trait,

Implement the Add operator for Mutable_string_slice_type.

§Safety

This function can fail silently if the buffer is not large enough.

Source§

fn add_assign(&mut self, Other: &str)

Performs the += operation. Read more
Source§

impl<'a, S> Debug for Mutable_string_type<'a, S>
where S: Size_trait + Debug,

Source§

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

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

impl Display for Mutable_string_type<'_>

Source§

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

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

impl PartialEq for Mutable_string_type<'_>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Mutable_string_type<'_>

Auto Trait Implementations§

§

impl<'a, S> Freeze for Mutable_string_type<'a, S>

§

impl<'a, S> RefUnwindSafe for Mutable_string_type<'a, S>
where S: RefUnwindSafe,

§

impl<'a, S> Send for Mutable_string_type<'a, S>
where S: Send,

§

impl<'a, S> Sync for Mutable_string_type<'a, S>
where S: Sync,

§

impl<'a, S> Unpin for Mutable_string_type<'a, S>

§

impl<'a, S = u32> !UnwindSafe for Mutable_string_type<'a, S>

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> 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>,

Source§

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>,

Source§

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.