[][src]Trait libmtp_rs::object::AsObjectId

pub trait AsObjectId {
    fn as_id(&self) -> u32;
}

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

fn as_id(&self) -> u32

Treat the implementor as an object id.

Loading content...

Implementations on Foreign Types

impl AsObjectId for u32[src]

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.

Loading content...

Implementors

impl<T> AsObjectId for T where
    T: Object
[src]

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

Loading content...