Skip to main content

Any

Trait Any 

Source
pub trait Any<T, B> {
    // Required method
    fn as_ref(&self) -> Ref<'_, T, B>;

    // Provided methods
    fn id(&self) -> Option<&Id<T, B>> { ... }
    fn language<'a>(&'a self) -> Option<&'a LenientLangTag>
       where T: 'a,
             B: 'a { ... }
    fn is_value(&self) -> bool { ... }
    fn is_node(&self) -> bool { ... }
    fn is_graph(&self) -> bool { ... }
    fn is_list(&self) -> bool { ... }
}
Expand description

Abstract object.

Required Methods§

Source

fn as_ref(&self) -> Ref<'_, T, B>

Borrows the object as a value, node or list reference.

Provided Methods§

Source

fn id(&self) -> Option<&Id<T, B>>

Returns the identifier (@id) of the object, if it is a node object with one.

Source

fn language<'a>(&'a self) -> Option<&'a LenientLangTag>
where T: 'a, B: 'a,

Returns the language tag of this value, if it carries one.

Source

fn is_value(&self) -> bool

Checks whether the object is a value object.

Source

fn is_node(&self) -> bool

Checks whether the object is a node object.

Source

fn is_graph(&self) -> bool

Checks whether the object is a graph object (a node object with a @graph entry).

Source

fn is_list(&self) -> bool

Checks whether the object is a list object.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, B> Any<T, B> for List<T, B>

Source§

impl<T, B> Any<T, B> for Node<T, B>

Source§

impl<T, B> Any<T, B> for Object<T, B>

Source§

impl<T, B> Any<T, B> for Value<T>