pub struct MediaId { /* private fields */ }Expand description
A movie, show, season, episode, artist, album or track:
<namespace>:<kind>:<key>.
Implementations§
Source§impl MediaId
impl MediaId
Sourcepub fn new(
namespace: Namespace,
kind: MediaKind,
key: impl Into<String>,
) -> Result<Self, IdError>
pub fn new( namespace: Namespace, kind: MediaKind, key: impl Into<String>, ) -> Result<Self, IdError>
Build an ID. The server does this; clients only receive them.
Sourcepub fn federated(origin_id: &str, remote: &MediaId) -> Result<Self, IdError>
pub fn federated(origin_id: &str, remote: &MediaId) -> Result<Self, IdError>
remote, an item of the server whose server id is origin, as
this server names it (P8-02): fed:<kind>:<origin>:<namespace>:<key>.
Sourcepub fn remote(&self) -> Option<(&str, MediaId)>
pub fn remote(&self) -> Option<(&str, MediaId)>
For a federated id: the origin’s server id, and the id the origin
knows the item by. None for any other id, or one that does not
read as one.
Sourcepub fn origin(&self) -> Option<&str>
pub fn origin(&self) -> Option<&str>
The server id of the paired server a federated id’s item is on;
None for this server’s own, as MediaId::remote reads it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MediaId
impl<'de> Deserialize<'de> for MediaId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MediaId
impl StructuralPartialEq for MediaId
Auto Trait Implementations§
impl Freeze for MediaId
impl RefUnwindSafe for MediaId
impl Send for MediaId
impl Sync for MediaId
impl Unpin for MediaId
impl UnsafeUnpin for MediaId
impl UnwindSafe for MediaId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more