pub trait FluentString: Sized {
Show 17 methods
// Required methods
fn f_clear(self) -> Self;
fn f_insert(self, idx: usize, ch: char) -> Self;
fn f_insert_str(self, idx: usize, string: &str) -> Self;
fn f_push(self, ch: char) -> Self;
fn f_push_str(self, string: &str) -> Self;
fn f_replace_range<R>(self, range: R, replace_with: &str) -> Self
where R: RangeBounds<usize>;
fn f_reserve(self, additional: usize) -> Self;
fn f_reserve_exact(self, additional: usize) -> Self;
fn f_retain<F>(self, f: F) -> Self
where F: FnMut(char) -> bool;
fn f_shrink_to(self, min_capacity: usize) -> Self;
fn f_shrink_to_fit(self) -> Self;
fn f_truncate(self, new_len: usize) -> Self;
fn f_try_reserve(self, additional: usize) -> Result<Self, TryReserveError>;
fn f_try_reserve_exact(
self,
additional: usize,
) -> Result<Self, TryReserveError>;
// Provided methods
fn f_push_if<F>(self, ch: char, f: F) -> Self
where F: Fn(&Self, char) -> bool { ... }
fn f_push_str_if<F>(self, string: &str, f: F) -> Self
where F: Fn(&Self, &str) -> bool { ... }
fn f_truncate_if<F>(self, f: F) -> Self
where F: Fn(&Self) -> Option<usize> { ... }
}
Required Methods§
Sourcefn f_insert_str(self, idx: usize, string: &str) -> Self
fn f_insert_str(self, idx: usize, string: &str) -> Self
As String::insert_str
except returns self
Sourcefn f_push_str(self, string: &str) -> Self
fn f_push_str(self, string: &str) -> Self
As String::push_str
except returns self
Sourcefn f_replace_range<R>(self, range: R, replace_with: &str) -> Selfwhere
R: RangeBounds<usize>,
fn f_replace_range<R>(self, range: R, replace_with: &str) -> Selfwhere
R: RangeBounds<usize>,
As String::replace_range
except returns self
Sourcefn f_reserve_exact(self, additional: usize) -> Self
fn f_reserve_exact(self, additional: usize) -> Self
As String::reserve_exact
except returns self
Sourcefn f_shrink_to(self, min_capacity: usize) -> Self
fn f_shrink_to(self, min_capacity: usize) -> Self
As String::shrink_to
except returns self
Sourcefn f_shrink_to_fit(self) -> Self
fn f_shrink_to_fit(self) -> Self
As String::shrink_to_fit
except returns self
Sourcefn f_truncate(self, new_len: usize) -> Self
fn f_truncate(self, new_len: usize) -> Self
As String::truncate
except returns self
Sourcefn f_try_reserve(self, additional: usize) -> Result<Self, TryReserveError>
fn f_try_reserve(self, additional: usize) -> Result<Self, TryReserveError>
As String::try_reserve
except returns Result<Self, TryReserveError>
§Errors
See String::try_reserve_exact
Sourcefn f_try_reserve_exact(self, additional: usize) -> Result<Self, TryReserveError>
fn f_try_reserve_exact(self, additional: usize) -> Result<Self, TryReserveError>
As String::try_reserve_exact
except returns Result<Self, TryReserveError>
§Errors
See String::try_reserve_exact
Provided Methods§
Sourcefn f_push_if<F>(self, ch: char, f: F) -> Self
fn f_push_if<F>(self, ch: char, f: F) -> Self
As FluentString::f_push
except only if f
returns true
Sourcefn f_push_str_if<F>(self, string: &str, f: F) -> Self
fn f_push_str_if<F>(self, string: &str, f: F) -> Self
As FluentString::f_push_str
except only if f
returns true
Sourcefn f_truncate_if<F>(self, f: F) -> Self
fn f_truncate_if<F>(self, f: F) -> Self
As FluentString::f_truncate
except only if f
returns Some(usize)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl FluentString for &mut String
Fluent versions of all &mut std::string:String
mutation methods that
otherwise return nothing.
impl FluentString for &mut String
Fluent versions of all &mut std::string:String
mutation methods that
otherwise return nothing.
fn f_clear(self) -> Self
fn f_insert(self, idx: usize, ch: char) -> Self
fn f_insert_str(self, idx: usize, string: &str) -> Self
fn f_push(self, ch: char) -> Self
fn f_push_str(self, string: &str) -> Self
fn f_replace_range<R>(self, range: R, replace_with: &str) -> Selfwhere
R: RangeBounds<usize>,
fn f_reserve(self, additional: usize) -> Self
fn f_reserve_exact(self, additional: usize) -> Self
fn f_retain<F>(self, f: F) -> Self
fn f_shrink_to(self, min_capacity: usize) -> Self
fn f_shrink_to_fit(self) -> Self
fn f_truncate(self, new_len: usize) -> Self
fn f_try_reserve(self, additional: usize) -> Result<Self, TryReserveError>
fn f_try_reserve_exact(self, additional: usize) -> Result<Self, TryReserveError>
Source§impl FluentString for String
Fluent versions of all std::string:String
mutation methods that
otherwise return nothing.
impl FluentString for String
Fluent versions of all std::string:String
mutation methods that
otherwise return nothing.