[][src]Struct web_static_pack::loader::Loader

pub struct Loader { /* fields omitted */ }

Main loader. Create using ::new() providing reference to result of include_bytes. Call get() to access files.

Implementations

impl Loader[src]

pub fn new(included_bytes: &'static [u8]) -> Result<Self, Error>[src]

Creates a loader. Pass result of std::include_bytes macro here. Create pack (for inclusion) with examples/packer.

pub fn get(&self, path: &str) -> Option<&FileDescriptor>[src]

Retrieves file from pack. The path should usually start with /, exactly as in URL. Returns Some(&FileDescriptor) if file is found, None otherwise.

Auto Trait Implementations

impl RefUnwindSafe for Loader

impl Send for Loader

impl Sync for Loader

impl Unpin for Loader

impl UnwindSafe for Loader

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, 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.