Struct jupiter::repository::loader::LoaderInfo
source · pub struct LoaderInfo { /* private fields */ }
Expand description
Wraps the metadata as well as the files being involved into a single struct which is provided to all loaders which loading or unloading data.
Implementations§
source§impl LoaderInfo
impl LoaderInfo
sourcepub fn loader_file_name(&self) -> Cow<'_, str>
pub fn loader_file_name(&self) -> Cow<'_, str>
Extracts the name of the file used to configure the loader.
sourcepub fn last_error(&self) -> String
pub fn last_error(&self) -> String
Retrieves the last known error this loader reported.
sourcepub fn store_error(&self, error: String)
pub fn store_error(&self, error: String)
Stores an error for this loader.
Note that this shouldn’t be called manually, as the background actor of the repository (which invokes the loaders) already takes care of reporting errors. The loader itself is of course in charge to create and report proper error when called.
sourcepub fn get_loader(&self) -> &Arc<dyn Loader>
pub fn get_loader(&self) -> &Arc<dyn Loader>
Provides access to the actual loader in charge.
sourcepub fn get_config(&self) -> &Yaml
pub fn get_config(&self) -> &Yaml
Provides access to the metadata of the loader.
sourcepub async fn get_data_str(&self) -> Result<String>
pub async fn get_data_str(&self) -> Result<String>
Fetches the contents of the data file as string.
Trait Implementations§
source§impl Clone for LoaderInfo
impl Clone for LoaderInfo
source§fn clone(&self) -> LoaderInfo
fn clone(&self) -> LoaderInfo
Returns a copy 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 Debug for LoaderInfo
impl Debug for LoaderInfo
Auto Trait Implementations§
impl Freeze for LoaderInfo
impl !RefUnwindSafe for LoaderInfo
impl Send for LoaderInfo
impl Sync for LoaderInfo
impl Unpin for LoaderInfo
impl !UnwindSafe for LoaderInfo
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more