Struct Text

Source
pub struct Text<'a> { /* private fields */ }
Expand description

Contains a string and a list of attributes

Implementations§

Source§

impl<'a> Text<'a>

Source

pub fn new<S, A>(string: S, attributes: A) -> Self
where S: Into<Cow<'a, str>>, A: Into<Vec<Attribute>>,

Takes a string and a list of attributes

Source

pub fn as_str(&self) -> &str

Source

pub fn attributes(&self) -> &[Attribute]

Source

pub fn into_string(self) -> String

See also: as_str

Trait Implementations§

Source§

impl<'a> Append for Text<'a>

Source§

fn append_by_ref(&self, i: &mut IterAppend<'_>)

Performs the append operation by borrowing self.
Source§

fn append(self, ia: &mut IterAppend<'_>)
where Self: Sized,

Performs the append operation by consuming self.
Source§

impl<'a> Arg for Text<'a>

Source§

const ARG_TYPE: ArgType = ArgType::Variant

The corresponding D-Bus argument type code.
Source§

fn signature() -> Signature<'static>

The corresponding D-Bus type signature for this type.
Source§

impl<'a> AsRef<str> for Text<'a>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> Clone for Text<'a>

Source§

fn clone(&self) -> Text<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Text<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a str> for Text<'a>

Source§

fn from(s: &'a str) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Text<'static>

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Text<'a>> for String

Source§

fn from(t: Text<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> Get<'a> for Text<'static>

Source§

fn get(i: &mut Iter<'a>) -> Option<Self>

Performs the get operation.
Source§

impl<'a> RefArg for Text<'a>

Source§

fn arg_type(&self) -> ArgType

The corresponding D-Bus argument type code.
Source§

fn signature(&self) -> Signature<'static>

The corresponding D-Bus type signature for this type.
Source§

fn append(&self, i: &mut IterAppend<'_>)

Performs the append operation.
Source§

fn as_any(&self) -> &dyn Any
where Self: 'static,

Transforms this argument to Any (which can be downcasted to read the current value). Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any
where Self: 'static,

Transforms this argument to Any (which can be downcasted to read the current value). Read more
Source§

fn box_clone(&self) -> Box<dyn RefArg + 'static>

Deep clone of the RefArg, causing the result to be ’static. Read more
Source§

fn as_i64(&self) -> Option<i64>

Try to read the argument as an i64. Read more
Source§

fn as_u64(&self) -> Option<u64>

Try to read the argument as an u64. Read more
Source§

fn as_f64(&self) -> Option<f64>

Try to read the argument as an f64. Read more
Source§

fn as_str(&self) -> Option<&str>

Try to read the argument as a str. Read more
Source§

fn as_iter<'a>( &'a self, ) -> Option<Box<dyn Iterator<Item = &'a dyn RefArg> + 'a>>

Try to read the argument as an iterator. Read more
Source§

fn as_static_inner(&self, _index: usize) -> Option<&(dyn RefArg + 'static)>
where Self: 'static,

Try to read the inner of an argument, as another argument, specifying an index. Read more
Source§

fn array_clone(_arg: &[Self]) -> Option<Box<dyn RefArg>>
where Self: Sized,

Deep clone of an array. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Text<'a>

§

impl<'a> RefUnwindSafe for Text<'a>

§

impl<'a> Send for Text<'a>

§

impl<'a> Sync for Text<'a>

§

impl<'a> Unpin for Text<'a>

§

impl<'a> UnwindSafe for Text<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.