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,
impl<'a, S> Mutable_string_type<'a, S>where
S: Size_trait,
Sourcepub unsafe fn From_unchecked(
String: NonNull<u8>,
Length: NonNull<S>,
Size: S,
) -> Self
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.
pub fn From( String: NonNull<u8>, Length: NonNull<S>, Size: S, ) -> Result<Self, Error_type>
pub fn Equal(&self, String: &str) -> bool
pub fn Concatenate(&mut self, String: &str) -> Result<(), Error_type>
pub fn Clear(&mut self)
pub fn Get_data(&'a mut self) -> &'a mut [u8] ⓘ
pub fn Get_length(&self) -> usize
pub fn Get_size(&self) -> usize
pub fn Get_characters(&self) -> Chars<'_>
pub fn Get_characters_indices(&self) -> impl Iterator<Item = (usize, char)> + '_
pub fn Get_lines(&'a self) -> Lines<'a>
pub fn As_str(&self) -> &str
Trait Implementations§
Source§impl<S> AddAssign<&str> for Mutable_string_type<'_, S>where
S: Size_trait,
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)
fn add_assign(&mut self, Other: &str)
Performs the
+=
operation. Read moreSource§impl<'a, S> Debug for Mutable_string_type<'a, S>where
S: Size_trait + Debug,
impl<'a, S> Debug for Mutable_string_type<'a, S>where
S: Size_trait + Debug,
Source§impl Display for Mutable_string_type<'_>
impl Display for Mutable_string_type<'_>
Source§impl PartialEq for Mutable_string_type<'_>
impl PartialEq for Mutable_string_type<'_>
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> 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