Struct keeshond_datapack::source::SourceManager
source · [−]pub struct SourceManager { /* private fields */ }
Expand description
Holds a list of Source objects and selects one to use when loading a package
Implementations
sourceimpl SourceManager
impl SourceManager
sourcepub fn new() -> SourceManager
pub fn new() -> SourceManager
Constructs a new, empty SourceManager
sourcepub fn add_source(&mut self, source: Box<dyn Source>) -> SourceId
pub fn add_source(&mut self, source: Box<dyn Source>) -> SourceId
Adds the given Source to the end of the list.
sourcepub fn source(&mut self, id: SourceId) -> Option<&mut Box<dyn Source>>
pub fn source(&mut self, id: SourceId) -> Option<&mut Box<dyn Source>>
Returns a reference to the Source of the given ID.
sourcepub fn package_source_id(&self, package_name: &str) -> SourceId
pub fn package_source_id(&self, package_name: &str) -> SourceId
Auto Trait Implementations
impl !RefUnwindSafe for SourceManager
impl !Send for SourceManager
impl !Sync for SourceManager
impl Unpin for SourceManager
impl !UnwindSafe for SourceManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more