[][src]Trait dbus::arg::RefArg

pub trait RefArg: Debug {
    fn arg_type(&self) -> ArgType;
fn signature(&self) -> Signature<'static>;
fn append(&self, _: &mut IterAppend);
fn as_any(&self) -> &dyn Any
    where
        Self: 'static
;
fn as_any_mut(&mut self) -> &mut dyn Any
    where
        Self: 'static
; fn as_i64(&self) -> Option<i64> { ... }
fn as_u64(&self) -> Option<u64> { ... }
fn as_f64(&self) -> Option<f64> { ... }
fn as_str(&self) -> Option<&str> { ... }
fn as_iter<'a>(
        &'a self
    ) -> Option<Box<dyn Iterator<Item = &'a dyn RefArg> + 'a>> { ... }
fn box_clone(&self) -> Box<dyn RefArg + 'static> { ... } }

Object safe version of Arg + Append + Get.

Required methods

fn arg_type(&self) -> ArgType

The corresponding D-Bus argument type code.

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

The corresponding D-Bus type signature for this type.

fn append(&self, _: &mut IterAppend)

Performs the append operation.

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

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

Note: The internal representation of complex types (Array, Dict, Struct) is unstable and as_any should not be relied upon for these types. Use as_iter instead.

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).

Note: The internal representation of complex types (Array, Dict, Struct) is unstable and as_any should not be relied upon for these types. Use as_iter instead.

Panic

Will panic if the interior cannot be made mutable, e g, if encapsulated inside a Rc with a reference count > 1.

Loading content...

Provided methods

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

Try to read the argument as an i64.

Works for: Boolean, Byte, Int16, UInt16, Int32, UInt32, Int64, UnixFd.

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

Try to read the argument as an u64.

Works for: Boolean, Byte, Int16, UInt16, Int32, UInt32, UInt64.

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

Try to read the argument as an f64.

Works for: Boolean, Byte, Int16, UInt16, Int32, UInt32, Double.

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

Try to read the argument as a str.

Works for: String, ObjectPath, Signature.

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

Try to read the argument as an iterator.

Works for: Array/Dict, Struct, Variant.

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

Deep clone of the RefArg, causing the result to be 'static.

Usable as an escape hatch in case of lifetime problems with RefArg.

In case of complex types (Array, Dict, Struct), the clone is not guaranteed to have the same internal representation as the original.

Loading content...

Implementations on Foreign Types

impl<'a, T: RefArg + ?Sized> RefArg for &'a T[src]

impl<T: RefArg + ?Sized> RefArg for Box<T>[src]

impl<T: RefArg + ?Sized> RefArg for Rc<T>[src]

impl<T: RefArg + ?Sized> RefArg for Arc<T>[src]

impl RefArg for u8[src]

impl RefArg for i16[src]

impl RefArg for u16[src]

impl RefArg for i32[src]

impl RefArg for u32[src]

impl RefArg for i64[src]

impl RefArg for u64[src]

impl RefArg for bool[src]

impl RefArg for f64[src]

impl RefArg for String[src]

impl<A: RefArg> RefArg for (A,)[src]

impl<A: RefArg, B: RefArg> RefArg for (A, B)[src]

impl<A: RefArg, B: RefArg, C: RefArg> RefArg for (A, B, C)[src]

impl<A: RefArg, B: RefArg, C: RefArg, D: RefArg> RefArg for (A, B, C, D)[src]

impl<A: RefArg, B: RefArg, C: RefArg, D: RefArg, E: RefArg> RefArg for (A, B, C, D, E)[src]

impl<A: RefArg, B: RefArg, C: RefArg, D: RefArg, E: RefArg, F: RefArg> RefArg for (A, B, C, D, E, F)[src]

impl<A: RefArg, B: RefArg, C: RefArg, D: RefArg, E: RefArg, F: RefArg, G: RefArg> RefArg for (A, B, C, D, E, F, G)[src]

impl<A: RefArg, B: RefArg, C: RefArg, D: RefArg, E: RefArg, F: RefArg, G: RefArg, H: RefArg> RefArg for (A, B, C, D, E, F, G, H)[src]

impl<A: RefArg, B: RefArg, C: RefArg, D: RefArg, E: RefArg, F: RefArg, G: RefArg, H: RefArg, I: RefArg> RefArg for (A, B, C, D, E, F, G, H, I)[src]

impl<A: RefArg, B: RefArg, C: RefArg, D: RefArg, E: RefArg, F: RefArg, G: RefArg, H: RefArg, I: RefArg, J: RefArg> RefArg for (A, B, C, D, E, F, G, H, I, J)[src]

impl<A: RefArg, B: RefArg, C: RefArg, D: RefArg, E: RefArg, F: RefArg, G: RefArg, H: RefArg, I: RefArg, J: RefArg, K: RefArg> RefArg for (A, B, C, D, E, F, G, H, I, J, K)[src]

impl<A: RefArg, B: RefArg, C: RefArg, D: RefArg, E: RefArg, F: RefArg, G: RefArg, H: RefArg, I: RefArg, J: RefArg, K: RefArg, L: RefArg> RefArg for (A, B, C, D, E, F, G, H, I, J, K, L)[src]

impl RefArg for Vec<Box<dyn RefArg>>[src]

impl<'a, T: Arg + RefArg> RefArg for &'a [T][src]

impl<T: Arg + RefArg> RefArg for Vec<T>[src]

impl<K: DictKey + RefArg + Eq + Hash, V: RefArg + Arg, S: BuildHasher> RefArg for HashMap<K, V, S>[src]

Loading content...

Implementors

impl RefArg for MessageItem[src]

impl RefArg for OwnedFd[src]

impl RefArg for ErrorName<'static>[src]

impl RefArg for Interface<'static>[src]

impl RefArg for Member<'static>[src]

impl RefArg for Path<'static>[src]

impl RefArg for Signature<'static>[src]

impl<'a, T: 'a + Arg + Debug + RefArg, I: Debug + Clone + Iterator<Item = &'a T>> RefArg for Array<'static, T, I>[src]

impl<T: RefArg> RefArg for Variant<T>[src]

Loading content...