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]
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 Default for FileTypeRegistry
[src]
impl Default for FileTypeRegistry
[src]Auto Trait Implementations
impl !RefUnwindSafe for FileTypeRegistry
impl !RefUnwindSafe for FileTypeRegistry
impl !Send for FileTypeRegistry
impl !Send for FileTypeRegistry
impl !Sync for FileTypeRegistry
impl !Sync for FileTypeRegistry
impl Unpin for FileTypeRegistry
impl Unpin for FileTypeRegistry
impl !UnwindSafe for FileTypeRegistry
impl !UnwindSafe for FileTypeRegistry