[][src]Struct keeshond_datapack::source::SourceManager

pub struct SourceManager { /* fields omitted */ }

Holds a list of Source objects and selects one to use when loading a package

Implementations

impl SourceManager[src]

pub fn new() -> SourceManager[src]

Constructs a new, empty SourceManager

pub fn add_source(&mut self, source: Box<dyn Source>) -> SourceId[src]

Adds the given Source to the end of the list.

pub fn source(&mut self, id: SourceId) -> Option<&mut Box<dyn Source>>[src]

Returns a reference to the Source of the given ID.

pub fn get_package_source(
    &mut self,
    package_name: &str
) -> Option<&mut Box<dyn Source>>
[src]

Retrieves a mutable reference to a Source that has the given package, going in reverse order of when they were added. If no suitable Source is available, returns None.

pub fn clear(&mut self)[src]

Removes all sources from the manager. Existing source IDs are invalidated.

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> Same<T> for T[src]

type Output = T

Should always be Self

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.