Struct plex_api::HttpClient
source · [−]pub struct HttpClient {
pub api_url: Uri,
pub http_client: IsahcHttpClient,
pub x_plex_provides: String,
pub x_plex_platform: String,
pub x_plex_platform_version: String,
pub x_plex_product: String,
pub x_plex_version: String,
pub x_plex_device: String,
pub x_plex_device_name: String,
pub x_plex_client_identifier: String,
pub x_plex_sync_version: String,
/* private fields */
}
Fields
api_url: Uri
http_client: IsahcHttpClient
x_plex_provides: String
X-Plex-Provides
header value. Comma-separated list.
Should be one or more of controller
, server
, sync-target
, player
.
x_plex_platform: String
X-Plex-Platform
header value.
Platform name, e.g. iOS, macOS, etc.
x_plex_platform_version: String
X-Plex-Platform-Version
header value.
OS version, e.g. 4.3.1
x_plex_product: String
X-Plex-Product
header value.
Application name, e.g. Laika, Plex Media Server, Media Link.
x_plex_version: String
X-Plex-Version
header value.
Application version, e.g. 10.6.7.
x_plex_device: String
X-Plex-Device
header value.
Device name and model number, e.g. iPhone3,2, Motorola XOOM™, LG5200TV.
x_plex_device_name: String
X-Plex-Device-Name
header value.
Primary name for the device, e.g. “Plex Web (Chrome)”.
x_plex_client_identifier: String
X-Plex-Client-Identifier
header value.
UUID, serial number, or other number unique per device.
N.B. Should be unique for each of your devices.
x_plex_sync_version: String
X-Plex-Sync-Version
header value.
Not sure what are the valid values, but at the time of writing Plex Web sends 2
here.
Implementations
sourceimpl HttpClient
impl HttpClient
pub fn is_authenticated(&self) -> bool
pub fn post<T>(&self, path: T) -> RequestBuilder<'_, T> where
PathAndQuery: TryFrom<T>,
<PathAndQuery as TryFrom<T>>::Error: Into<Error>,
pub fn get<T>(&self, path: T) -> RequestBuilder<'_, T> where
PathAndQuery: TryFrom<T>,
<PathAndQuery as TryFrom<T>>::Error: Into<Error>,
pub fn put<T>(&self, path: T) -> RequestBuilder<'_, T> where
PathAndQuery: TryFrom<T>,
<PathAndQuery as TryFrom<T>>::Error: Into<Error>,
pub fn delete<T>(&self, path: T) -> RequestBuilder<'_, T> where
PathAndQuery: TryFrom<T>,
<PathAndQuery as TryFrom<T>>::Error: Into<Error>,
sourcepub fn set_x_plex_token(self, x_plex_token: String) -> Self
pub fn set_x_plex_token(self, x_plex_token: String) -> Self
Set the client’s authentication token.
sourcepub fn x_plex_token(&self) -> &str
pub fn x_plex_token(&self) -> &str
Get a reference to the client’s authentication token.
Trait Implementations
sourceimpl Clone for HttpClient
impl Clone for HttpClient
sourcefn clone(&self) -> HttpClient
fn clone(&self) -> HttpClient
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl !UnwindSafe for HttpClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more