#[repr(C)]pub struct NSMutableString {
pub ptr: Id<Object>,
}
Expand description
A mutable string.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NSMutableString
impl NSMutableString
Sourcepub fn string_with_capacity(capacity: UInt) -> NSMutableString
pub fn string_with_capacity(capacity: UInt) -> NSMutableString
Sourcepub fn init_with_capacity(&mut self, capacity: UInt) -> NSMutableStringwhere
Self: Sized,
pub fn init_with_capacity(&mut self, capacity: UInt) -> NSMutableStringwhere
Self: Sized,
Returns an NSMutableString object initialized with initial storage for a given number of characters,
§Arguments
capacity
- The number of characters to allocate space for.
Sourcepub fn append_string<S>(&mut self, string: S)where
S: INSString,
pub fn append_string<S>(&mut self, string: S)where
S: INSString,
Adds a constructed string to the receiver.
§Arguments
string
- The string to append to the receiver.
Sourcepub fn apply_transform_reverse_range_updated_range(
&mut self,
transform: NSStringTransform,
reverse: bool,
range: NSRange,
out_range: NSRange,
) -> bool
pub fn apply_transform_reverse_range_updated_range( &mut self, transform: NSStringTransform, reverse: bool, range: NSRange, out_range: NSRange, ) -> bool
Transliterates the receiver by applying a specified ICU string transform.
§Arguments
transform
- TheStringTransform
to apply.reverse
- Iftrue
, the transformation is applied in reverse.range
- The range of characters to apply the transformation to.out_range
- The range of characters that were transformed.
§Returns
true
if the transformation was successful, otherwise false
.
Sourcepub fn delete_characters_in_range(&mut self, range: NSRange)
pub fn delete_characters_in_range(&mut self, range: NSRange)
Removes from the receiver the characters in a given range.
§Arguments
range
- The range of characters to remove.
Sourcepub fn insert_string_at_index<S>(&mut self, string: S, loc: UInt)where
S: INSString,
pub fn insert_string_at_index<S>(&mut self, string: S, loc: UInt)where
S: INSString,
Inserts into the receiver the characters of a given string at a given location.
§Arguments
string
- The string to insert into the receiver.loc
- The location at which to insertstring
.
Sourcepub fn replace_characters_in_range_with_string<S>(
&mut self,
range: NSRange,
string: S,
)where
S: INSString,
pub fn replace_characters_in_range_with_string<S>(
&mut self,
range: NSRange,
string: S,
)where
S: INSString,
Replaces the characters from aRange with those in string
.
§Arguments
range
- The range of characters to replace.string
- The string to replace with.
Sourcepub fn replace_occurrences_of_string_with_string_options_range<S>(
&mut self,
target: NSString,
replacement: S,
options: NSStringCompareOptions,
search_range: NSRange,
) -> UIntwhere
S: INSString,
pub fn replace_occurrences_of_string_with_string_options_range<S>(
&mut self,
target: NSString,
replacement: S,
options: NSStringCompareOptions,
search_range: NSRange,
) -> UIntwhere
S: INSString,
Replaces all occurrences of a given string in a given range with another given string, returning the number of replacements.
Sourcepub fn set_string<S>(&mut self, string: S)where
S: INSString,
pub fn set_string<S>(&mut self, string: S)where
S: INSString,
Replaces the characters of the receiver with those in a given string.
§Arguments
string
- The string to replace the characters of the receiver with. string must not benull
.
Methods from Deref<Target = Object>§
Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Returns a reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Sourcepub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
pub unsafe fn get_mut_ivar<T>(&mut self, name: &str) -> &mut Twhere
T: Encode,
Returns a mutable reference to the ivar of self with the given name.
Panics if self has no ivar with the given name.
Unsafe because the caller must ensure that the ivar is actually
of type T
.
Trait Implementations§
Source§impl Clone for NSMutableString
impl Clone for NSMutableString
Source§impl Debug for NSMutableString
impl Debug for NSMutableString
Source§impl Default for NSMutableString
impl Default for NSMutableString
Source§impl Deref for NSMutableString
impl Deref for NSMutableString
Source§impl DerefMut for NSMutableString
impl DerefMut for NSMutableString
Source§impl Display for NSMutableString
impl Display for NSMutableString
Source§impl Encode for NSMutableString
impl Encode for NSMutableString
Source§impl From<NSMutableString> for NSString
impl From<NSMutableString> for NSString
Source§fn from(string: NSMutableString) -> Self
fn from(string: NSMutableString) -> Self
Source§impl From<NSString> for NSMutableString
impl From<NSString> for NSMutableString
Source§impl FromId for NSMutableString
impl FromId for NSMutableString
Source§impl Hash for NSMutableString
impl Hash for NSMutableString
Source§impl INSMutableString for NSMutableString
impl INSMutableString for NSMutableString
Source§fn m_string_with_capacity(capacity: UInt) -> NSMutableString
fn m_string_with_capacity(capacity: UInt) -> NSMutableString
Source§fn m_init_with_capacity(&mut self, capacity: UInt) -> NSMutableStringwhere
Self: Sized,
fn m_init_with_capacity(&mut self, capacity: UInt) -> NSMutableStringwhere
Self: Sized,
Source§fn m_append_string<S>(&mut self, string: S)where
S: INSString,
fn m_append_string<S>(&mut self, string: S)where
S: INSString,
Source§fn m_apply_transform_reverse_range_updated_range(
&mut self,
transform: NSStringTransform,
reverse: bool,
range: NSRange,
out_range: NSRange,
) -> bool
fn m_apply_transform_reverse_range_updated_range( &mut self, transform: NSStringTransform, reverse: bool, range: NSRange, out_range: NSRange, ) -> bool
Source§fn m_delete_characters_in_range(&mut self, range: NSRange)
fn m_delete_characters_in_range(&mut self, range: NSRange)
Source§fn m_insert_string_at_index<S>(&mut self, string: S, loc: UInt)where
S: INSString,
fn m_insert_string_at_index<S>(&mut self, string: S, loc: UInt)where
S: INSString,
Source§fn m_replace_characters_in_range_with_string<S>(
&mut self,
range: NSRange,
string: S,
)where
S: INSString,
fn m_replace_characters_in_range_with_string<S>(
&mut self,
range: NSRange,
string: S,
)where
S: INSString,
string
. Read moreSource§fn m_replace_occurrences_of_string_with_string_options_range<S>(
&mut self,
target: NSString,
replacement: S,
options: NSStringCompareOptions,
search_range: NSRange,
) -> UIntwhere
S: INSString,
fn m_replace_occurrences_of_string_with_string_options_range<S>(
&mut self,
target: NSString,
replacement: S,
options: NSStringCompareOptions,
search_range: NSRange,
) -> UIntwhere
S: INSString,
Source§fn m_set_string<S>(&mut self, string: S)where
S: INSString,
fn m_set_string<S>(&mut self, string: S)where
S: INSString,
Source§impl INSString for NSMutableString
impl INSString for NSMutableString
Source§fn m_init(&mut self) -> Self
fn m_init(&mut self) -> Self
Source§fn m_init_with_bytes_length_encoding(
&mut self,
bytes: *const c_void,
len: UInt,
encoding: Encoding,
) -> Self
fn m_init_with_bytes_length_encoding( &mut self, bytes: *const c_void, len: UInt, encoding: Encoding, ) -> Self
Source§fn m_init_with_bytes_no_copy_length_encoding_free_when_done(
&mut self,
bytes: *mut c_void,
len: UInt,
encoding: Encoding,
free_buffer: bool,
) -> Self
fn m_init_with_bytes_no_copy_length_encoding_free_when_done( &mut self, bytes: *mut c_void, len: UInt, encoding: Encoding, free_buffer: bool, ) -> Self
Source§fn m_init_with_characters_length(
&mut self,
characters: *const unichar,
len: UInt,
) -> Self
fn m_init_with_characters_length( &mut self, characters: *const unichar, len: UInt, ) -> Self
Source§fn m_init_with_characters_no_copy_length_free_when_done(
&mut self,
characters: unichar,
length: UInt,
free_buffer: bool,
) -> Self
fn m_init_with_characters_no_copy_length_free_when_done( &mut self, characters: unichar, length: UInt, free_buffer: bool, ) -> Self
Source§fn m_init_with_string<S>(&mut self, s: S) -> Self
fn m_init_with_string<S>(&mut self, s: S) -> Self
Source§fn m_init_with_cstring_encoding(
&mut self,
c_str: *const c_char,
encoding: Encoding,
) -> Self
fn m_init_with_cstring_encoding( &mut self, c_str: *const c_char, encoding: Encoding, ) -> Self
Source§fn m_init_with_utf8_string(&mut self, c_str: *const c_char) -> Self
fn m_init_with_utf8_string(&mut self, c_str: *const c_char) -> Self
Source§fn m_init_with_data_encoding(
&mut self,
data: NSData,
encoding: Encoding,
) -> Self
fn m_init_with_data_encoding( &mut self, data: NSData, encoding: Encoding, ) -> Self
Source§fn m_localized_user_notification_string_for_key_arguments<T>(
key: NSString,
arguments: NSArray<T>,
) -> NSStringwhere
T: PNSObject,
fn m_localized_user_notification_string_for_key_arguments<T>(
key: NSString,
arguments: NSArray<T>,
) -> NSStringwhere
T: PNSObject,
Source§fn m_string_with_characters_length(
characters: *const unichar,
length: UInt,
) -> Self
fn m_string_with_characters_length( characters: *const unichar, length: UInt, ) -> Self
Source§fn m_string_with_string(s: NSString) -> Self
fn m_string_with_string(s: NSString) -> Self
Source§fn m_string_with_cstring_encoding(
c_str: *const c_char,
encoding: Encoding,
) -> Self
fn m_string_with_cstring_encoding( c_str: *const c_char, encoding: Encoding, ) -> Self
Source§fn m_string_with_utf8_string(c_str: *const c_char) -> Self
fn m_string_with_utf8_string(c_str: *const c_char) -> Self
Source§fn m_string_with_contents_of_file_encoding(
path: &NSString,
enc: Encoding,
) -> Result<Self, NSError>
fn m_string_with_contents_of_file_encoding( path: &NSString, enc: Encoding, ) -> Result<Self, NSError>
Source§fn m_init_with_contents_of_file_encoding(
&mut self,
path: &NSString,
enc: Encoding,
) -> Result<Self, NSError>
fn m_init_with_contents_of_file_encoding( &mut self, path: &NSString, enc: Encoding, ) -> Result<Self, NSError>
NSString
object initialized by reading data from the file at a given path using a given encoding.Source§fn m_string_with_contents_of_file_used_encoding(
path: &NSString,
enc: Encoding,
) -> Result<Self, NSError>
fn m_string_with_contents_of_file_used_encoding( path: &NSString, enc: Encoding, ) -> Result<Self, NSError>
NSString
object initialized by reading data from the file at a given path using a given encoding.Source§fn m_init_with_contents_of_file_used_encoding(
&mut self,
path: &NSString,
enc: Encoding,
) -> Result<Self, NSError>
fn m_init_with_contents_of_file_used_encoding( &mut self, path: &NSString, enc: Encoding, ) -> Result<Self, NSError>
Source§fn m_string_with_contents_of_url_encoding(
path: &NSURL,
enc: Encoding,
) -> Result<Self, NSError>
fn m_string_with_contents_of_url_encoding( path: &NSURL, enc: Encoding, ) -> Result<Self, NSError>
Source§fn m_init_with_contents_of_url_encoding(
&mut self,
path: &NSURL,
enc: Encoding,
) -> Result<Self, NSError>
fn m_init_with_contents_of_url_encoding( &mut self, path: &NSURL, enc: Encoding, ) -> Result<Self, NSError>
NSString
object initialized by reading data from a given URL interpreted using a given encoding.Source§fn m_string_with_contents_of_url_used_encoding(
path: &NSURL,
enc: Encoding,
) -> Result<Self, NSError>
fn m_string_with_contents_of_url_used_encoding( path: &NSURL, enc: Encoding, ) -> Result<Self, NSError>
Source§fn m_init_with_contents_of_url_used_encoding(
&mut self,
path: &NSURL,
enc: Encoding,
) -> Result<Self, NSError>
fn m_init_with_contents_of_url_used_encoding( &mut self, path: &NSURL, enc: Encoding, ) -> Result<Self, NSError>
NSString
object initialized by reading data from a given URL and returns by reference the encoding used to interpret the data.