pub struct Server {
pub myplex_api_url: Uri,
pub media_container: Server,
/* private fields */
}
Fields§
§myplex_api_url: Uri
§media_container: Server
Implementations§
Source§impl Server
impl Server
pub async fn new<U>(url: U, client: HttpClient) -> Result<Self>
pub fn libraries(&self) -> Vec<Library>
Sourcepub async fn transcode_artwork<W>(
&self,
art: &str,
width: u32,
height: u32,
options: ArtTranscodeOptions,
writer: W,
) -> Result<()>where
W: AsyncWrite + Unpin,
pub async fn transcode_artwork<W>(
&self,
art: &str,
width: u32,
height: u32,
options: ArtTranscodeOptions,
writer: W,
) -> Result<()>where
W: AsyncWrite + Unpin,
Given the path to some item’s artwork (art
or thumb
properties for
example but many other types of images will work) this will request a
scaled version of that image be written to the passed writer as a JPEG.
The image will always maintain its aspect ratio.
Sourcepub async fn transcode_sessions(&self) -> Result<Vec<TranscodeSession>>
pub async fn transcode_sessions(&self) -> Result<Vec<TranscodeSession>>
Retrieves a list of the current transcode sessions.
Sourcepub async fn transcode_session(
&self,
session_id: &str,
) -> Result<TranscodeSession>
pub async fn transcode_session( &self, session_id: &str, ) -> Result<TranscodeSession>
Retrieves the transcode session with the passed ID.
Sourcepub async fn item_by_id(&self, rating_key: &str) -> Result<Item>
pub async fn item_by_id(&self, rating_key: &str) -> Result<Item>
Allows retrieving media, playlists, collections and other items using their rating key.
Sourcepub async fn mark_watched<M: MediaItem + FromMetadata>(
&self,
item: &M,
) -> Result<M>
pub async fn mark_watched<M: MediaItem + FromMetadata>( &self, item: &M, ) -> Result<M>
Marks a media item as fully watched increasing its view count by one.
Sourcepub async fn mark_unwatched<M: MediaItem + FromMetadata>(
&self,
item: &M,
) -> Result<M>
pub async fn mark_unwatched<M: MediaItem + FromMetadata>( &self, item: &M, ) -> Result<M>
Marks a media item as unwatched.
Sourcepub async fn update_timeline<M: MediaItem + FromMetadata>(
&self,
item: &M,
position: u64,
) -> Result<M>
pub async fn update_timeline<M: MediaItem + FromMetadata>( &self, item: &M, position: u64, ) -> Result<M>
Sets a media item’s playback position in milliseconds. The server currently ignores any positions equal to or less than 60000ms. The time sets the time the item was last viewed.
pub async fn refresh(self) -> Result<Self>
pub fn myplex(&self) -> Result<MyPlex>
pub async fn claim(self, claim_token: &str) -> Result<Self>
pub async fn unclaim(self) -> Result<Self>
pub fn myplex_with_api_url<U>(&self, api_url: U) -> Result<MyPlex>
pub fn client(&self) -> &HttpClient
pub async fn preferences<'a>(&self) -> Result<Preferences<'a>>
pub fn machine_identifier(&self) -> &str
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
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