AsObjectId

Trait AsObjectId 

Source
pub trait AsObjectId {
    // Required method
    fn as_id(&self) -> u32;
}
Expand description

Trait to allow the usage of certain structures or plain u32 in places where an object id is required. By default every Object implementor automagically implements this trait.

Beware that although some functions accept any AsObjectId implementor, this isn’t going to be always correct, because some operations are made to work only on certain types of objects (like files, tracks, folders, etc). Also note that using plain u32 is dangerous, unless you know what you are doing.

Required Methods§

Source

fn as_id(&self) -> u32

Treat the implementor as an object id.

Implementations on Foreign Types§

Source§

impl AsObjectId for u32

Note that this is just a convenience implementaion in case you have known valid object id as u32 somewhere else, or you just want to use the Object::id method to pass the plain u32.

Source§

fn as_id(&self) -> u32

Implementors§

Source§

impl<T> AsObjectId for T
where T: Object,

All Object implementors can be treated as an object id given that they already have the Object::id method.