[][src]Enum imgix::url::Scheme

pub enum Scheme {
    Https,
    Http,
}

Primary value for expressing which scheme a url uses.

This is an enum to define and enforce the crate semantics of what it means for a url to be valid for our use-case. A url can be in one of two states: it either uses https or it uses http. While this can be achieved by toggling https on and off via a boolean value, a boolean value weakens the semantics and constrains the range of possible schemes that can be used in the future.

Using Scheme::Https is also more explicit than saying url.https(true), it also has the added benefit of being discoverable. When usage is url.scheme(Scheme::...), the range of possible schemes can be discovered by IDE code completion tools.

Variants

Https
Http

Trait Implementations

impl Debug for Scheme[src]

impl Display for Scheme[src]

impl PartialEq<Scheme> for Scheme[src]

impl StructuralPartialEq for Scheme[src]

Auto Trait Implementations

impl RefUnwindSafe for Scheme

impl Send for Scheme

impl Sync for Scheme

impl Unpin for Scheme

impl UnwindSafe for Scheme

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> From<T> for T[src]

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

impl<T> ToString for T where
    T: Display + ?Sized
[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.