Trait Object

Source
pub unsafe trait Object: Any { }
Expand description

This trait is the primary function of the library. Object trait objects can be freely queried for any other trait, allowing conversion between trait objects.

Implementations§

Source§

impl dyn Object

Source

pub fn query_ref<U: Any + ?Sized>(&self) -> Option<&U>

Source

pub fn query_mut<U: Any + ?Sized>(&mut self) -> Option<&mut U>

Source

pub fn query<U: Any + ?Sized>(self: Box<Self>) -> Result<Box<U>, Box<Self>>

Source

pub fn query_arc<U: Any + ?Sized>(self_: Arc<Self>) -> Result<Arc<U>, Arc<Self>>

Source

pub fn query_rc<U: Any + ?Sized>(self_: Rc<Self>) -> Result<Rc<U>, Rc<Self>>

Source

pub fn obj_partial_eq(&self, other: &Self) -> bool

Source

pub fn obj_partial_cmp(&self, other: &Self) -> Option<Ordering>

Trait Implementations§

Source§

impl Clone for Box<dyn Object>

Source§

fn clone(&self) -> Self

Returns a copy 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 Debug for dyn Object

Source§

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

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

impl Hash for dyn Object

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
Source§

impl Ord for dyn Object

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl PartialEq for dyn Object

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for dyn Object

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl ToOwned for dyn Object

Source§

type Owned = Box<dyn Object>

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Box<dyn Object>

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

fn clone_into(&self, target: &mut Self::Owned)

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

impl Eq for dyn Object

Source§

impl HasInterface<dyn Object> for PathBuf

Source§

impl HasInterface<dyn Object> for String

Source§

impl HasInterface<dyn Object> for Vec<PathBuf>

Source§

impl HasInterface<dyn Object> for Vec<String>

Source§

impl HasInterface<dyn Object> for Vec<bool>

Source§

impl HasInterface<dyn Object> for Vec<char>

Source§

impl HasInterface<dyn Object> for Vec<f32>

Source§

impl HasInterface<dyn Object> for Vec<f64>

Source§

impl HasInterface<dyn Object> for Vec<i16>

Source§

impl HasInterface<dyn Object> for Vec<i32>

Source§

impl HasInterface<dyn Object> for Vec<i64>

Source§

impl HasInterface<dyn Object> for Vec<i8>

Source§

impl HasInterface<dyn Object> for Vec<u16>

Source§

impl HasInterface<dyn Object> for Vec<u32>

Source§

impl HasInterface<dyn Object> for Vec<u64>

Source§

impl HasInterface<dyn Object> for Vec<u8>

Source§

impl HasInterface<dyn Object> for bool

Source§

impl HasInterface<dyn Object> for char

Source§

impl HasInterface<dyn Object> for f32

Source§

impl HasInterface<dyn Object> for f64

Source§

impl HasInterface<dyn Object> for i16

Source§

impl HasInterface<dyn Object> for i32

Source§

impl HasInterface<dyn Object> for i64

Source§

impl HasInterface<dyn Object> for i8

Source§

impl HasInterface<dyn Object> for u16

Source§

impl HasInterface<dyn Object> for u32

Source§

impl HasInterface<dyn Object> for u64

Source§

impl HasInterface<dyn Object> for u8

Implementations on Foreign Types§

Source§

impl Object for bool

Source§

impl Object for char

Source§

impl Object for f32

Source§

impl Object for f64

Source§

impl Object for i8

Source§

impl Object for i16

Source§

impl Object for i32

Source§

impl Object for i64

Source§

impl Object for u8

Source§

impl Object for u16

Source§

impl Object for u32

Source§

impl Object for u64

Source§

impl Object for String

Source§

impl Object for Vec<bool>

Source§

impl Object for Vec<char>

Source§

impl Object for Vec<f32>

Source§

impl Object for Vec<f64>

Source§

impl Object for Vec<i8>

Source§

impl Object for Vec<i16>

Source§

impl Object for Vec<i32>

Source§

impl Object for Vec<i64>

Source§

impl Object for Vec<u8>

Source§

impl Object for Vec<u16>

Source§

impl Object for Vec<u32>

Source§

impl Object for Vec<u64>

Source§

impl Object for Vec<String>

Source§

impl Object for Vec<PathBuf>

Source§

impl Object for PathBuf

Implementors§