#[repr(C)]pub struct NSAttributedString {
pub ptr: Id<Object>,
}
Expand description
A string with associated attributes (such as visual style, hyperlinks, or accessibility data) for portions of its text.
Fields§
§ptr: Id<Object>
The raw pointer to the Objective-C object.
Implementations§
Source§impl NSAttributedString
impl NSAttributedString
Sourcepub fn init_with_string(string: &NSString) -> Self
pub fn init_with_string(string: &NSString) -> Self
Creates an attributed string with the characters of the specified string and no attribute information.
Sourcepub fn init_with_string_attributes(
string: &NSString,
attributes: &NSDictionary<NSAttributedStringKey, id>,
) -> Self
pub fn init_with_string_attributes( string: &NSString, attributes: &NSDictionary<NSAttributedStringKey, id>, ) -> Self
Creates an attributed string with the specified string and attributes.
Sourcepub fn init_with_attributed_string(attr_string: &NSAttributedString) -> Self
pub fn init_with_attributed_string(attr_string: &NSAttributedString) -> Self
Creates an attributed string with the characters and attributes of the specified attributed string.
Sourcepub fn init_with_data_options_document_attributes(
data: &NSData,
options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, id>,
document: &NSDictionary<NSAttributedStringDocumentAttributeKey, id>,
) -> Result<Self, NSError>
pub fn init_with_data_options_document_attributes( data: &NSData, options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, id>, document: &NSDictionary<NSAttributedStringDocumentAttributeKey, id>, ) -> Result<Self, NSError>
Creates an attributed string from the data in the specified data object.
Sourcepub fn attributes_at_index_effective_range(
&self,
location: UInt,
range: NSRangePointer,
) -> NSDictionary<NSAttributedStringKey, id>
pub fn attributes_at_index_effective_range( &self, location: UInt, range: NSRangePointer, ) -> NSDictionary<NSAttributedStringKey, id>
Returns the attributes for the character at the specified index.
Sourcepub fn attributes_at_index_longest_effective_range_in_range(
&self,
location: UInt,
range: NSRangePointer,
range_limit: NSRange,
) -> NSDictionary<NSAttributedStringKey, id>
pub fn attributes_at_index_longest_effective_range_in_range( &self, location: UInt, range: NSRangePointer, range_limit: NSRange, ) -> NSDictionary<NSAttributedStringKey, id>
Returns the attributes for the character at the specified index and, by reference, the range where the attributes apply.
Sourcepub fn is_equal_to_attributed_string(&self, other: &NSAttributedString) -> bool
pub fn is_equal_to_attributed_string(&self, other: &NSAttributedString) -> bool
Returns a Boolean value that indicates whether the attributed string is equal to another attributed string.
Sourcepub fn attributed_substring_from_range(
&self,
range: NSRange,
) -> NSAttributedString
pub fn attributed_substring_from_range( &self, range: NSRange, ) -> NSAttributedString
Returns an attributed string consisting of the characters and attributes within the specified range in the attributed string.
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
.