pub struct AttributedString {
pub string: String,
pub attributes: Vec<StringAttributeRef>,
}Expand description
A string that carries a list of StringAttributes.
Fields§
§string: StringThe plain string stored in the attributed string.
attributes: Vec<StringAttributeRef>The attributes this string carries.
The list must not be modified after this string is created.
Implementations§
Source§impl AttributedString
impl AttributedString
Sourcepub fn new(string: impl Into<String>) -> AttributedString
pub fn new(string: impl Into<String>) -> AttributedString
Creates a attributed string.
Sourcepub fn attributes(self, attributes: Vec<StringAttributeRef>) -> AttributedString
pub fn attributes(self, attributes: Vec<StringAttributeRef>) -> AttributedString
Dart AttributedString(attributes:).
The TextRange in the attributes must be inside the length of the
string.
The attributes must not be changed after the attributed string is
created.
Trait Implementations§
Source§impl Add for AttributedString
impl Add for AttributedString
Source§fn add(self, other: AttributedString) -> AttributedString
fn add(self, other: AttributedString) -> AttributedString
Returns a new AttributedString by concatenate the operands
The string attribute list of the returned AttributedString will contains
the string attributes from both operands with updated text ranges.
Source§type Output = AttributedString
type Output = AttributedString
The resulting type after applying the
+ operator.Source§impl Clone for AttributedString
impl Clone for AttributedString
Source§impl Debug for AttributedString
impl Debug for AttributedString
Source§impl PartialEq for AttributedString
Two AttributedStrings are equal if their string and attributes are; an attribute equals
only itself.
impl PartialEq for AttributedString
Two AttributedStrings are equal if their string and attributes are; an attribute equals
only itself.
Auto Trait Implementations§
impl !RefUnwindSafe for AttributedString
impl !Send for AttributedString
impl !Sync for AttributedString
impl !UnwindSafe for AttributedString
impl Forget for AttributedString
impl Freeze for AttributedStringwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Rc<dyn StringAttribute>>: Freeze,
impl Move for AttributedString
impl Unpin for AttributedString
impl UnsafeUnpin for AttributedStringwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Rc<dyn StringAttribute>>: UnsafeUnpin,
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