Struct atelier_assembler::FileTypeRegistry[][src]

pub struct FileTypeRegistry { /* fields omitted */ }

A mapping from file extension to file type. Note that FileTypeRegistry::default will always contain at least mappings for “.json” and “.smithy” file types. Note that file extensions will always be compared in a case insensitive manner.

Implementations

impl FileTypeRegistry[src]

pub fn empty() -> Self[src]

Construct an empty registry.

pub fn register(&mut self, file_type: Rc<FileType>, extension: &str)[src]

Add a mapping from file extension to reader function.

pub fn register_all(&mut self, file_type: Rc<FileType>, extensions: &[&str])[src]

Add a mapping from file extension to reader function.

pub fn contains(&self, extension: &str) -> bool[src]

Returns true if there is a reader function for the provided extension, else false.

pub fn get(&self, extension: &str) -> Option<&Rc<FileType>>[src]

Returns the reader function for the provided extension, if present.

pub fn get_by_mime_type(&self, mime_type: &str) -> Option<&Rc<FileType>>[src]

Returns the reader function for the provided MIME type, if present.

pub fn remove(&mut self, extension: &str) -> Option<Rc<FileType>>[src]

Remove the mapping for the provided extension.

pub fn extensions(&self) -> impl Iterator<Item = &String>[src]

Return an iterator over the extensions currently supported.

Trait Implementations

impl Debug for FileTypeRegistry[src]

impl Default for FileTypeRegistry[src]

Auto Trait Implementations

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.