[−][src]Struct staticvec::StaticString
A fixed-capacity String-like struct built around an instance of
StaticVec<u8, N>.
Methods
impl<const N: usize> StaticString<N>[src]
pub const fn new() -> Self[src]
Returns a new StaticString instance.
Example usage:
let string = StaticString::<20>::new(); assert!(string.is_empty());
pub fn from_str<S: AsRef<str>>(string: S) -> Self[src]
Creates a new StaticString from a string slice, truncating the slice as necessary if it has a length greater than the StaticString's declared capacity.
Example usage:
let string = StaticString::<20>::from_str("My String"); assert_eq!(string.as_str(), "My String"); println!("{}", string); let truncate = "0".repeat(21); let truncated = "0".repeat(20); let string = StaticString::<20>::from_str(&truncate); assert_eq!(string.as_str(), truncated);
pub fn try_from_str<S: AsRef<str>>(string: S) -> Result<Self, CapacityError<N>>[src]
Creates a new StaticString from a string slice if the slice has a length less than or equal
to the StaticString's declared capacity, or returns StringError::OutOfBounds otherwise.
Example usage:
let string = StaticString::<20>::try_from_str("My String")?; assert_eq!(string.as_str(), "My String"); assert_eq!(StaticString::<20>::try_from_str("")?.as_str(), ""); let out_of_bounds = "0".repeat(21); assert!(StaticString::<20>::try_from_str(out_of_bounds).is_err());
pub fn from_iterator<U: AsRef<str>, I: IntoIterator<Item = U>>(iter: I) -> Self[src]
Creates a new StaticString from the contents of an iterator, returning immediately if and when the StaticString reaches maximum capacity regardless of whether or not the iterator still has more items to yield.
Example usage:
let string = StaticString::<300>::from_iterator(&["My String", " Other String"][..]); assert_eq!(string.as_str(), "My String Other String"); let out_of_bounds = (0..400).map(|_| "000"); let truncated = "0".repeat(20); let truncate = StaticString::<20>::from_iterator(out_of_bounds); assert_eq!(truncate.as_str(), truncated.as_str());
pub fn try_from_iterator<U: AsRef<str>, I: IntoIterator<Item = U>>(
iter: I
) -> Result<Self, CapacityError<N>>[src]
iter: I
) -> Result<Self, CapacityError<N>>
Creates a new StaticString from the contents of an iterator if the iterator has a length less
than or equal to the StaticString's declared capacity, or returns
StringError::OutOfBounds otherwise.
Example usage:
let string = StaticString::<300>::try_from_iterator(&["My String", " My Other String"][..])?; assert_eq!(string.as_str(), "My String My Other String"); let out_of_bounds = (0..100).map(|_| "000"); assert!(StaticString::<20>::try_from_iterator(out_of_bounds).is_err());
pub fn from_chars<I: IntoIterator<Item = char>>(iter: I) -> Self[src]
Creates a new StaticString from the contents of a char iterator, returning immediately if
and when the StaticString reaches maximum capacity regardless of whether or not the iterator
still has more items to yield.
let string = StaticString::<20>::from_chars("My String".chars()); assert_eq!(string.as_str(), "My String"); let out_of_bounds = "0".repeat(21); let truncated = "0".repeat(20); let truncate = StaticString::<20>::from_chars(out_of_bounds.chars()); assert_eq!(truncate.as_str(), truncated.as_str());
pub fn try_from_chars<I: IntoIterator<Item = char>>(
iter: I
) -> Result<Self, StringError>[src]
iter: I
) -> Result<Self, StringError>
Creates a new StaticString from the contents of a char iterator if the iterator has a length
less than or equal to the StaticString's declared capacity, or returns
StringError::OutOfBounds otherwise.
Example usage:
let string = StaticString::<20>::try_from_chars("My String".chars())?; assert_eq!(string.as_str(), "My String"); let out_of_bounds = "0".repeat(21); assert!(StaticString::<20>::try_from_chars(out_of_bounds.chars()).is_err());
pub unsafe fn from_utf8_unchecked<B: AsRef<[u8]>>(slice: B) -> Self[src]
Creates a new StaticString instance from a provided byte slice, without doing any checking to ensure that the slice contains valid UTF-8 data and has a length less than or equal to the declared capacity of the StaticString.
Safety
The length of the slice must not exceed the declared capacity of the StaticString being created, as this would result in writing to an out-of-bounds memory region.
The slice must also contain strictly valid UTF-8 data, as if it does not, various assumptions made in the internal implementation of StaticString will be silently invalidated, almost certainly eventually resulting in undefined behavior.
Example usage:
let string = unsafe { StaticString::<20>::from_utf8_unchecked("My String") }; assert_eq!(string.as_str(), "My String"); // Undefined behavior, don't do it: // let out_of_bounds = "0".repeat(300); // let ub = unsafe { StaticString::<20>::from_utf8_unchecked(out_of_bounds)) };
pub fn from_utf8<B: AsRef<[u8]>>(slice: B) -> Result<Self, StringError>[src]
Creates a new StaticString instance from a provided byte slice, returning
StringError::Utf8 on invalid UTF-8 data, and truncating the input slice as necessary if
it has a length greater than the declared capacity of the StaticString being created.
Example usage:
let string = StaticString::<20>::from_utf8("My String")?; assert_eq!(string.as_str(), "My String"); let invalid_utf8 = [0, 159, 146, 150]; assert!(StaticString::<20>::from_utf8(invalid_utf8).unwrap_err().is_utf8()); let out_of_bounds = "0".repeat(300); assert_eq!(StaticString::<20>::from_utf8(out_of_bounds.as_bytes())?.as_str(), "0".repeat(20).as_str());
pub fn try_from_utf8<B: AsRef<[u8]>>(slice: B) -> Result<Self, StringError>[src]
Creates a new StaticString from a byte slice, returning StringError::Utf8 on invalid UTF-8
data or StringError::OutOfBounds if the slice has a length greater than the StaticString's
declared capacity.
Example usage:
let string = StaticString::<20>::try_from_utf8("My String")?; assert_eq!(string.as_str(), "My String"); let invalid_utf8 = [0, 159, 146, 150]; assert!(StaticString::<20>::try_from_utf8(invalid_utf8).unwrap_err().is_utf8()); let out_of_bounds = "0000".repeat(400); assert!(StaticString::<20>::try_from_utf8(out_of_bounds.as_bytes()).unwrap_err().is_out_of_bounds());
pub fn from_utf16_lossy<B: AsRef<[u16]>>(slice: B) -> Self[src]
Creates a new StaticString instance from a provided u16 slice, replacing invalid UTF-16 data
with REPLACEMENT_CHARACTER (�), and truncating the input slice as necessary if
it has a length greater than the declared capacity of the StaticString being created.
Example usage:
let music = [0xD834, 0xDD1E, 0x006d, 0x0075, 0x0073, 0x0069, 0x0063]; let string = StaticString::<20>::from_utf16_lossy(music); assert_eq!(string.as_str(), "𝄞music"); let invalid_utf16 = [0xD834, 0xDD1E, 0x006d, 0x0075, 0xD800, 0x0069, 0x0063]; assert_eq!(StaticString::<20>::from_utf16_lossy(invalid_utf16).as_str(), "𝄞mu\u{FFFD}ic"); let out_of_bounds: Vec<u16> = (0..300).map(|_| 0).collect(); assert_eq!(StaticString::<20>::from_utf16_lossy(&out_of_bounds).as_str(), "\0".repeat(20).as_str());
pub fn from_utf16<B: AsRef<[u16]>>(slice: B) -> Result<Self, StringError>[src]
Creates a new StaticString instance from a provided u16 slice, returning
StringError::Utf16 on invalid UTF-16 data, and truncating the input slice as necessary if
it has a length greater than the declared capacity of the StaticString being created.
Example usage:
let music = [0xD834, 0xDD1E, 0x006d, 0x0075, 0x0073, 0x0069, 0x0063]; let string = StaticString::<20>::from_utf16(music)?; assert_eq!(string.as_str(), "𝄞music"); let invalid_utf16 = [0xD834, 0xDD1E, 0x006d, 0x0075, 0xD800, 0x0069, 0x0063]; assert!(StaticString::<20>::from_utf16(invalid_utf16).unwrap_err().is_utf16()); let out_of_bounds: Vec<u16> = (0..300).map(|_| 0).collect(); assert_eq!(StaticString::<20>::from_utf16(out_of_bounds)?.as_str(), "\0".repeat(20).as_str());
pub fn try_from_utf16<B: AsRef<[u16]>>(slice: B) -> Result<Self, StringError>[src]
Creates a new StaticString from provided u16 slice, returning StringError::Utf16 on
invalid UTF-16 data or StringError::OutOfBounds if the slice has a length greater than the
declared capacity of the StaticString being created.
Example usage:
let music = [0xD834, 0xDD1E, 0x006d, 0x0075, 0x0073, 0x0069, 0x0063]; let string = StaticString::<20>::try_from_utf16(music)?; assert_eq!(string.as_str(), "𝄞music"); let invalid_utf16 = [0xD834, 0xDD1E, 0x006d, 0x0075, 0xD800, 0x0069, 0x0063]; assert!(StaticString::<20>::try_from_utf16(invalid_utf16).unwrap_err().is_utf16()); let out_of_bounds: Vec<_> = (0..300).map(|_| 0).collect(); assert!(StaticString::<20>::try_from_utf16(out_of_bounds).unwrap_err().is_out_of_bounds());
pub const fn as_str(&self) -> &str[src]
Extracts a str slice containing the entire contents of the StaticString.
Example usage:
let s = StaticString::<20>::try_from_str("My String")?; assert_eq!(s.as_str(), "My String");
pub const fn as_mut_str(&mut self) -> &mut str[src]
Extracts a mutable str slice containing the entire contents of the StaticString.
Example usage:
let mut s = StaticString::<20>::try_from_str("My String")?; assert_eq!(s.as_mut_str(), "My String");
pub const fn as_bytes(&self) -> &[u8][src]
Extracts a u8 slice containing the entire contents of the StaticString.
Example usage:
let s = StaticString::<20>::try_from_str("My String")?; assert_eq!(s.as_bytes(), "My String".as_bytes());
pub const unsafe fn as_mut_bytes(&mut self) -> &mut [u8][src]
Extracts a mutable u8 slice containing the entire contents of the StaticString.
Safety
Care must be taken to ensure that the returned u8 slice is not mutated in such a way that
it no longer amounts to valid UTF-8.
Example usage:
let mut s = StaticString::<20>::try_from_str("My String")?; assert_eq!(unsafe { s.as_mut_bytes() }, "My String".as_bytes());
pub const fn capacity(&self) -> usize[src]
Returns the total capacity of the StaticString.
This is always equivalent to the generic N parameter it was declared with,
which determines the fixed size of the backing StaticVec instance.
Example usage:
assert_eq!(StaticString::<32>::new().capacity(), 32);
pub const fn remaining_capacity(&self) -> usize[src]
Returns the remaining capacity (which is to say, self.capacity() - self.len()) of the
StaticString.
Example usage:
assert_eq!(StaticString::<32>::from("abcd").remaining_capacity(), 28);
pub fn push_str<S: AsRef<str>>(&mut self, string: S)[src]
Attempts to push string to the StaticString, panicking if it is the case that self.len() + string.len() exceeds the StaticString's total capacity.
Example usage:
let mut s = StaticString::<6>::from("foo"); s.push_str("bar"); assert_eq!(s, "foobar");
pub fn push_str_truncating<S: AsRef<str>>(&mut self, string: S)[src]
Attempts to push string to the StaticString. Truncates string as necessary (or simply does
nothing at all) if it is the case that self.len() + string.len() exceeds the
StaticString's total capacity.
Example usage:
let mut s = StaticString::<300>::try_from_str("My String")?; s.push_str_truncating(" My other String"); assert_eq!(s.as_str(), "My String My other String"); let mut s = StaticString::<20>::new(); s.push_str_truncating("0".repeat(21)); assert_eq!(s.as_str(), "0".repeat(20).as_str());
pub fn try_push_str<S: AsRef<str>>(
&mut self,
string: S
) -> Result<(), CapacityError<N>>[src]
&mut self,
string: S
) -> Result<(), CapacityError<N>>
Pushes string to the StaticString if self.len() + string.len() does not exceed
the StaticString's total capacity, or returns a
CapacityError otherwise.
Example usage:
let mut s = StaticString::<300>::try_from_str("My String")?; s.try_push_str(" My other String")?; assert_eq!(s.as_str(), "My String My other String"); assert!(s.try_push_str("0".repeat(300)).is_err());
pub unsafe fn push_unchecked(&mut self, character: char)[src]
Appends the given char to the end of the StaticString without doing any checking to ensure
that self.len() + character.len_utf8() does not exceed the total capacity of the
StaticString instance.
Safety
self.len() + character.len_utf8() must not exceed the total capacity of the StaticString
instance, as this would result in writing to an out-of-bounds memory region.
Example usage:
let mut s = StaticString::<20>::try_from_str("My String")?; unsafe { s.push_unchecked('!') }; assert_eq!(s.as_str(), "My String!"); // Undefined behavior, don't do it: // s = StaticString::<20>::try_from_str(&"0".repeat(20))?; // s.push_unchecked('!');
pub fn push(&mut self, character: char)[src]
Appends the given char to the end of the StaticString, panicking if the StaticString is already at maximum capacity.
Example usage:
let mut string = StaticString::<2>::new(); string.push('a'); string.push('b'); assert_eq!(&string[..], "ab");
pub fn try_push(&mut self, character: char) -> Result<(), StringError>[src]
Appends the given char to the end of the StaticString, returning StringError::OutOfBounds
if the StaticString is already at maximum capacity.
Example usage:
let mut s = StaticString::<20>::try_from_str("My String")?; s.try_push('!')?; assert_eq!(s.as_str(), "My String!"); let mut s = StaticString::<20>::try_from_str(&"0".repeat(20))?; assert!(s.try_push('!').is_err());
pub fn truncate(&mut self, size: usize) -> Result<(), StringError>[src]
Truncates the StaticString to the specified length if the length is both less than the StaticString's current length and also a valid UTF-8 character index, or does nothing otherwise.
Example usage:
let mut s = StaticString::<20>::try_from_str("My String")?; s.truncate(5)?; assert_eq!(s.as_str(), "My St"); // Does nothing s.truncate(6)?; assert_eq!(s.as_str(), "My St"); // Index is not at a valid char let mut s = StaticString::<20>::try_from_str("🤔")?; assert!(s.truncate(1).is_err());
pub fn pop(&mut self) -> Option<char>[src]
Returns the last character in the StaticString in Some if the StaticString's current length
is greater than zero, or None otherwise.
Example usage:
let mut s = StaticString::<20>::try_from_str("A🤔")?; assert_eq!(s.pop(), Some('🤔')); assert_eq!(s.pop(), Some('A')); assert_eq!(s.pop(), None);
pub fn trim(&mut self)[src]
Removes all whitespace from the beginning and end of the StaticString, if any is present.
Example usage:
let mut string = StaticString::<300>::try_from_str(" to be trimmed ")?; string.trim(); assert_eq!(string.as_str(), "to be trimmed"); let mut string = StaticString::<20>::try_from_str(" 🤔")?; string.trim(); assert_eq!(string.as_str(), "🤔");
pub fn remove(&mut self, index: usize) -> Result<char, StringError>[src]
Removes the char at index from the StaticString if index is both less than self.len()
and also a valid UTF-8 character boundary, or panics otherwise.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD🤔")?; assert!(s.remove("ABCD🤔".len()).unwrap_err().is_out_of_bounds()); assert!(s.remove(10).unwrap_err().is_out_of_bounds()); assert!(s.remove(6).unwrap_err().is_not_char_boundary()); assert_eq!(s.remove(0), Ok('A')); assert_eq!(s.as_str(), "BCD🤔"); assert_eq!(s.remove(2), Ok('D')); assert_eq!(s.as_str(), "BC🤔");
pub fn retain<F: FnMut(char) -> bool>(&mut self, f: F)[src]
Removes all characters from the StaticString except for those specified by the predicate function.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD🤔")?; s.retain(|c| c != '🤔'); assert_eq!(s.as_str(), "ABCD");
pub unsafe fn insert_unchecked(&mut self, index: usize, character: char)[src]
Inserts character at index without doing any checking to ensure that the StaticVec is not
already at maximum capacity or that index indicates a valid UTF-8 character boundary.
Safety
The length of the StaticString prior to calling this function must be less than its total capacity, as if this in not the case it will result in writing to an out-of-bounds memory region.
Index must also represent a valid UTF-8 character boundary, as if it does not, various
assumptions made in the internal implementation of StaticString will be silently
invalidated, almost certainly eventually resulting in undefined behavior.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD🤔")?; unsafe { s.insert_unchecked(1, 'A') }; unsafe { s.insert_unchecked(1, 'B') }; assert_eq!(s.as_str(), "ABABCD🤔"); // Undefined behavior, don't do it: // s.insert(20, 'C'); // s.insert(8, 'D');
pub fn try_insert(
&mut self,
index: usize,
character: char
) -> Result<(), StringError>[src]
&mut self,
index: usize,
character: char
) -> Result<(), StringError>
Inserts character at index, returning StringError::OutOfBounds if the StaticString is
already at maximum capacity and StringError::Utf8 if index is not a valid UTF-8
character index.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD🤔")?; s.try_insert(1, 'E')?; s.try_insert(2, 'F')?; assert_eq!(s.as_str(), "AEFBCD🤔"); assert!(s.try_insert(20, 'C').unwrap_err().is_out_of_bounds()); assert!(s.try_insert(8, 'D').unwrap_err().is_not_char_boundary()); let mut s = StaticString::<20>::try_from_str(&"0".repeat(20))?; assert!(s.try_insert(0, 'C').unwrap_err().is_out_of_bounds());
pub fn insert(&mut self, index: usize, character: char)[src]
Inserts character at index, panicking if the StaticString is already at maximum capacity
or if index does not lie at a valid UTF-8 character index.
Example usage:
let mut s = StaticString::<3>::new(); s.insert(0, 'f'); s.insert(1, 'o'); s.insert(2, 'o'); assert_eq!(s, "foo");
pub fn try_insert_str<S: AsRef<str>>(
&mut self,
index: usize,
string: S
) -> Result<(), StringError>[src]
&mut self,
index: usize,
string: S
) -> Result<(), StringError>
Inserts string at index, returning StringError::OutOfBounds if self.len() + string.len() exceeds the total capacity of the StaticString and StringError::Utf8 if
index is not a valid UTF-8 character index.
Example usage:
let mut string = StaticString::<20>::try_from_str("ABCD🤔")?; string.try_insert_str(1, "AB")?; string.try_insert_str(1, "BC")?; assert!(string.try_insert_str(1, "0".repeat(20)).unwrap_err().is_out_of_bounds()); assert_eq!(string.as_str(), "ABCABBCD🤔"); assert!(string.try_insert_str(20, "C").unwrap_err().is_out_of_bounds()); assert!(string.try_insert_str(10, "D").unwrap_err().is_not_char_boundary());
pub fn insert_str<S: AsRef<str>>(
&mut self,
index: usize,
string: S
) -> Result<(), StringError>[src]
&mut self,
index: usize,
string: S
) -> Result<(), StringError>
Inserts string at index, truncating string as necessary if it is the case that
self.len() + string.len() exceeds the total capacity of the StaticString.
Returns StringError::OutOfBounds if index is outside the range 0..self.len() and
StringError::Utf8 if index is not a valid UTF-8 character position.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD🤔")?; s.insert_str(1, "AB")?; s.insert_str(1, "BC")?; assert_eq!(s.as_str(), "ABCABBCD🤔"); assert!(s.insert_str(20, "C").unwrap_err().is_out_of_bounds()); assert!(s.insert_str(10, "D").unwrap_err().is_not_char_boundary()); s.clear(); s.insert_str(0, "0".repeat(30))?; assert_eq!(s.as_str(), "0".repeat(20).as_str());
pub unsafe fn insert_str_unchecked<S: AsRef<str>>(
&mut self,
index: usize,
string: S
)[src]
&mut self,
index: usize,
string: S
)
Inserts string at index without doing any checking to ensure that self.len() + string.len() does not exceed the total capacity of the StaticString or that index
indicates a valid UTF-8 character boundary.
Safety
self.len() + string.len() must not exceed the total capacity of the StaticString instance,
as this would result in writing to an out-of-bounds memory region.
Index must also represent a valid UTF-8 character boundary, as if it does not, various
assumptions made in the internal implementation of StaticString will be silently
invalidated, almost certainly eventually resulting in undefined behavior.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD🤔")?; unsafe { s.insert_str_unchecked(1, "AB") }; unsafe { s.insert_str_unchecked(1, "BC") }; assert_eq!(s.as_str(), "ABCABBCD🤔"); // Undefined behavior, don't do it: // unsafe { s.insert_str_unchecked(20, "C") }; // unsafe { s.insert_str_unchecked(10, "D") }; // unsafe { s.insert_str_unchecked(1, "0".repeat(20)) };
pub const fn len(&self) -> usize[src]
Returns the current length of the StaticString.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD")?; assert_eq!(s.len(), 4); s.try_push('🤔')?; // Emojis use 4 bytes (this is the default rust behavior, length of usize) assert_eq!(s.len(), 8);
pub const fn is_empty(&self) -> bool[src]
Returns true if the StaticString has a current length of 0.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD")?; assert!(!s.is_empty()); s.clear(); assert!(s.is_empty());
pub const fn is_full(&self) -> bool[src]
Returns true if the StaticString's length is equal to its capacity.
Example usage:
let mut s = StaticString::<4>::try_from_str("ABCD")?; assert!(s.is_full()); s.clear(); assert!(!s.is_full());
pub fn split_off(&mut self, at: usize) -> Result<Self, StringError>[src]
Splits the StaticString in two if at is less than the its current length.
The original StaticString will contain elements 0..at, and the new one will contain
elements at..self.len().
Returns StringError::Utf8 if at does not represent a valid UTF-8 character boundary and
StringError::OutOfBounds if it falls outside the range 0..self.len().
Example usage:
let mut s = StaticString::<20>::try_from_str("AB🤔CD")?; assert_eq!(s.split_off(6)?.as_str(), "CD"); assert_eq!(s.as_str(), "AB🤔"); assert!(s.split_off(20).unwrap_err().is_out_of_bounds()); assert!(s.split_off(4).unwrap_err().is_not_char_boundary());
pub fn clear(&mut self)[src]
Removes all contents from the StaticString and sets its length back to zero.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD")?; assert!(!s.is_empty()); s.clear(); assert!(s.is_empty());
pub fn replace_range<S: AsRef<str>, R: RangeBounds<usize>>(
&mut self,
range: R,
with: S
) -> Result<(), StringError>[src]
&mut self,
range: R,
with: S
) -> Result<(), StringError>
Removes the specified range from the StaticString and replaces it with the provided input
(which does not need to have the same length as the range being removed), returning
StringError::OutOfBounds if the range does not fall within 0..self.len(), and
StringError::NotCharBoundary if the range does not begin at a valid UTF-8 character
boundary.
Example usage:
let mut s = StaticString::<20>::try_from_str("ABCD🤔")?; s.replace_range(2..4, "EFGHI")?; assert_eq!(s.as_str(), "ABEFGHI🤔"); assert!(s.replace_range(9.., "J").unwrap_err().is_not_char_boundary()); assert!(s.replace_range(..90, "K").unwrap_err().is_out_of_bounds()); assert!(s.replace_range(0..1, "0".repeat(20)).unwrap_err().is_out_of_bounds());
Trait Implementations
impl<'a, const N: usize> Add<&'a str> for StaticString<N>[src]
type Output = Self
The resulting type after applying the + operator.
fn add(self, other: &str) -> Self::Output[src]
impl<const N: usize> AsMut<str> for StaticString<N>[src]
impl<const N: usize> AsRef<[u8]> for StaticString<N>[src]
impl<const N: usize> AsRef<str> for StaticString<N>[src]
impl<const N: usize> Borrow<str> for StaticString<N>[src]
impl<const N: usize> BorrowMut<str> for StaticString<N>[src]
fn borrow_mut(&mut self) -> &mut str[src]
impl<const N: usize> Clone for StaticString<N>[src]
fn clone(&self) -> StaticString<N>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<const N: usize> Debug for StaticString<N>[src]
impl<const N: usize> Default for StaticString<N>[src]
impl<const N: usize> Deref for StaticString<N>[src]
impl<const N: usize> DerefMut for StaticString<N>[src]
impl<const N: usize> Display for StaticString<N>[src]
impl<const N: usize> Eq for StaticString<N>[src]
impl<'a, const N: usize> Extend<&'a char> for StaticString<N>[src]
fn extend<I: IntoIterator<Item = &'a char>>(&mut self, iter: I)[src]
impl<'a, const N: usize> Extend<&'a str> for StaticString<N>[src]
fn extend<I: IntoIterator<Item = &'a str>>(&mut self, iterable: I)[src]
impl<const N: usize> Extend<char> for StaticString<N>[src]
fn extend<I: IntoIterator<Item = char>>(&mut self, iterable: I)[src]
impl<'a, const N: usize> From<&'a str> for StaticString<N>[src]
impl<'a, const N: usize> FromIterator<&'a str> for StaticString<N>[src]
fn from_iter<I: IntoIterator<Item = &'a str>>(iter: I) -> Self[src]
impl<const N: usize> FromIterator<char> for StaticString<N>[src]
fn from_iter<I: IntoIterator<Item = char>>(iter: I) -> Self[src]
impl<'a, const N: usize> FromStr for StaticString<N>[src]
type Err = ()
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>[src]
impl<const N: usize> Hash for StaticString<N>[src]
fn hash<H: Hasher>(&self, hasher: &mut H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<const N: usize> Index<Range<usize>> for StaticString<N>[src]
type Output = str
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &Self::Output[src]
impl<const N: usize> Index<RangeFrom<usize>> for StaticString<N>[src]
type Output = str
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &Self::Output[src]
impl<const N: usize> Index<RangeFull> for StaticString<N>[src]
type Output = str
The returned type after indexing.
fn index(&self, index: RangeFull) -> &Self::Output[src]
impl<const N: usize> Index<RangeInclusive<usize>> for StaticString<N>[src]
type Output = str
The returned type after indexing.
fn index(&self, index: RangeInclusive<usize>) -> &Self::Output[src]
impl<const N: usize> Index<RangeTo<usize>> for StaticString<N>[src]
type Output = str
The returned type after indexing.
fn index(&self, index: RangeTo<usize>) -> &Self::Output[src]
impl<const N: usize> Index<RangeToInclusive<usize>> for StaticString<N>[src]
type Output = str
The returned type after indexing.
fn index(&self, index: RangeToInclusive<usize>) -> &Self::Output[src]
impl<const N: usize> IndexMut<Range<usize>> for StaticString<N>[src]
impl<const N: usize> IndexMut<RangeFrom<usize>> for StaticString<N>[src]
impl<const N: usize> IndexMut<RangeFull> for StaticString<N>[src]
impl<const N: usize> IndexMut<RangeInclusive<usize>> for StaticString<N>[src]
fn index_mut(&mut self, index: RangeInclusive<usize>) -> &mut str[src]
impl<const N: usize> IndexMut<RangeTo<usize>> for StaticString<N>[src]
impl<const N: usize> IndexMut<RangeToInclusive<usize>> for StaticString<N>[src]
fn index_mut(&mut self, index: RangeToInclusive<usize>) -> &mut str[src]
impl<const N: usize> Ord for StaticString<N>[src]
fn cmp(&self, other: &Self) -> Ordering[src]
fn max(self, other: Self) -> Self1.21.0[src]
fn min(self, other: Self) -> Self1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self[src]
impl<'_, const N: usize> PartialEq<&'_ str> for StaticString<N>[src]
impl<const N: usize> PartialEq<StaticString<N>> for StaticString<N>[src]
impl<const N: usize> PartialEq<str> for StaticString<N>[src]
impl<'_, const N: usize> PartialOrd<&'_ str> for StaticString<N>[src]
fn partial_cmp(&self, other: &&str) -> Option<Ordering>[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<const N: usize> PartialOrd<StaticString<N>> for StaticString<N>[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<const N: usize> PartialOrd<str> for StaticString<N>[src]
fn partial_cmp(&self, other: &str) -> Option<Ordering>[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
impl<const N: usize> Write for StaticString<N>[src]
Auto Trait Implementations
impl<const N: usize> RefUnwindSafe for StaticString<N>
impl<const N: usize> Send for StaticString<N>
impl<const N: usize> Sync for StaticString<N>
impl<const N: usize> Unpin for StaticString<N>
impl<const N: usize> UnwindSafe for StaticString<N>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,