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() -> TypeLoaderCollection
pub fn new() -> TypeLoaderCollection
Create a new type loader collection containing only the generated type loader and the fallback type loader.
Sourcepub fn new_empty() -> TypeLoaderCollection
pub fn new_empty() -> TypeLoaderCollection
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) -> <&TypeLoaderCollection as IntoIterator>::IntoIter
pub fn iter(&self) -> <&TypeLoaderCollection 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§fn default() -> TypeLoaderCollection
fn default() -> TypeLoaderCollection
Returns the “default value” for a type. Read more
Source§impl<'a> IntoIterator for &'a TypeLoaderCollection
impl<'a> IntoIterator for &'a TypeLoaderCollection
Source§type Item = &'a Arc<dyn TypeLoader>
type Item = &'a Arc<dyn TypeLoader>
The type of the elements being iterated over.
Source§type IntoIter = <&'a [Arc<dyn TypeLoader>] as IntoIterator>::IntoIter
type IntoIter = <&'a [Arc<dyn TypeLoader>] as IntoIterator>::IntoIter
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <&'a TypeLoaderCollection as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a TypeLoaderCollection as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Auto Trait Implementations§
impl Freeze for TypeLoaderCollection
impl !RefUnwindSafe for TypeLoaderCollection
impl Send for TypeLoaderCollection
impl Sync for TypeLoaderCollection
impl Unpin for TypeLoaderCollection
impl UnsafeUnpin 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