pub struct TypeLoaderCollection { /* private fields */ }Expand description
Wrapper type around a vector of type loaders that maintains
sorted order according to the priority of each type loader.
Implementations§
Source§impl TypeLoaderCollection
impl TypeLoaderCollection
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new type loader collection containing only the generated type loader and the fallback type loader.
Sourcepub fn new_empty() -> Self
pub fn new_empty() -> Self
Create a new type loader collection without any type loaders at all, not even the built-ins. This is usually only useful for testing.
Sourcepub fn add_type_loader(&mut self, loader: impl TypeLoader + 'static)
pub fn add_type_loader(&mut self, loader: impl TypeLoader + 'static)
Add a type loader to the collection.
Sourcepub fn add(&mut self, loader: Arc<dyn TypeLoader>)
pub fn add(&mut self, loader: Arc<dyn TypeLoader>)
Add a type loader to the collection.
Sourcepub fn iter(&self) -> <&Self as IntoIterator>::IntoIter
pub fn iter(&self) -> <&Self as IntoIterator>::IntoIter
Iterate over the type loaders.
Trait Implementations§
Source§impl Clone for TypeLoaderCollection
impl Clone for TypeLoaderCollection
Source§fn clone(&self) -> TypeLoaderCollection
fn clone(&self) -> TypeLoaderCollection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for TypeLoaderCollection
impl Default for TypeLoaderCollection
Source§impl<'a> IntoIterator for &'a TypeLoaderCollection
impl<'a> IntoIterator for &'a TypeLoaderCollection
Auto Trait Implementations§
impl Freeze for TypeLoaderCollection
impl !RefUnwindSafe for TypeLoaderCollection
impl Send for TypeLoaderCollection
impl Sync for TypeLoaderCollection
impl Unpin for TypeLoaderCollection
impl !UnwindSafe for TypeLoaderCollection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more