[][src]Struct mediaproxy_common::query::Query

pub struct Query {
    pub source: String,
    pub width: Option<u32>,
    pub height: Option<u32>,
    pub format: OutputFormat,
    pub fit_mode: Option<ResizeStrategy>,
}

The default object that clients use to make requests to Media Proxy.

Fields

source: String

URL of the source image. Input formats currently supported are the same as those of the [image] crate.

width: Option<u32>

The width of the processed image.

height: Option<u32>

The height of the processed image.

format: OutputFormat

Output format of the image.

fit_mode: Option<ResizeStrategy>

Strategy for resizing image.

Implementations

impl Query[src]

pub fn to_fingerprint(&self) -> String[src]

Convert a Query to a fingerprint.

In reality, this just serializes the Query to JSON and encodes it in base64.

pub fn from_fingerprint(fingerprint: String) -> Result<Query, FingerprintError>[src]

Create a Query from a base64 encoded fingerprint. Fingerprints can be created with Query.to_fingerprint().

Arguments

  • fingerprint - A base64 encoded Query in JSON.

Example

use mediaproxy_common::query::Query;
let query = Query::from_fingerprint("eyJzb3VyY2UiOiJodHRwczovL2R1bW15aW1hZ2UuY29tLzYwMHg0MDAvMDAwL2ZmZiIsIndpZHRoIjpudWxsLCJoZWlnaHQiOm51bGwsImZvcm1hdCI6ImpwZWcifQ".to_string());

Trait Implementations

impl<'de> Deserialize<'de> for Query[src]

impl Serialize for Query[src]

Auto Trait Implementations

impl RefUnwindSafe for Query

impl Send for Query

impl Sync for Query

impl Unpin for Query

impl UnwindSafe for Query

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.