Skip to main content

AnyClass

Trait AnyClass 

Source
pub trait AnyClass:
    Debug
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn index(&self) -> usize;
    fn add_dev(&self, name: &str) -> Result<Arc<dyn AnyDev>>;
}
Expand description

A class of any model, which is how the server holds its classes.

Required Methods§

Source

fn name(&self) -> &str

The name of that class.

Source

fn index(&self) -> usize

The rank of that class among the classes of its server, which is the order they were made in and the order their devices are initialized in, see Server::sync.

Source

fn add_dev(&self, name: &str) -> Result<Arc<dyn AnyDev>>

Add a device of that class to the server, see Class::add_dev.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<M: Model> AnyClass for Class<M>