pub struct Metadata {
pub path: Option<PathBuf>,
pub source: Source,
pub level: u8,
pub trust: Trust,
}
Expand description
Additional information about a section.
Fields
path: Option<PathBuf>
The file path of the source, if known.
source: Source
Where the section is coming from.
level: u8
The levels of indirection of the file, with 0 being a section
that was directly loaded, and 1 being an include.path
of a
level 0 file.
trust: Trust
The trust-level for the section this meta-data is associated with.
Implementations
sourceimpl Metadata
impl Metadata
Instantiation
sourcepub fn try_from_path(
path: impl Into<PathBuf>,
source: Source
) -> Result<Metadata, Error>
pub fn try_from_path(
path: impl Into<PathBuf>,
source: Source
) -> Result<Metadata, Error>
Return metadata as derived from the given path
at source
, which will also be used to derive the trust level
by checking its ownership.
Trait Implementations
sourceimpl Ord for Metadata
impl Ord for Metadata
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Metadata> for Metadata
impl PartialOrd<Metadata> for Metadata
sourcefn partial_cmp(&self, other: &Metadata) -> Option<Ordering>
fn partial_cmp(&self, other: &Metadata) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Metadata
impl StructuralEq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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