pub struct FragmentResource {
pub manifest: FragmentManifest,
pub path: PathBuf,
pub fragment_md_path: PathBuf,
pub layer_precedence: u32,
}Expand description
A discovered fragment resource with its manifest, filesystem path, and layer precedence.
The manifest metadata is available immediately. The full fragment body can
be loaded on demand via load_body.
Fields§
§manifest: FragmentManifestThe parsed fragment manifest (metadata only).
path: PathBufAbsolute path to the fragment directory (containing FRAGMENT.md).
fragment_md_path: PathBufPath to the FRAGMENT.md file itself, for on-demand body loading.
layer_precedence: u32Precedence value of the discovery layer that produced this resource.
Implementations§
Source§impl FragmentResource
impl FragmentResource
Sourcepub fn load_body(&self) -> Result<String, FragmentDiscoveryError>
pub fn load_body(&self) -> Result<String, FragmentDiscoveryError>
Load the full fragment body (everything after the frontmatter) on demand.
This reads the FRAGMENT.md file from disk, strips the frontmatter,
and returns the remaining content.
Trait Implementations§
Source§impl Clone for FragmentResource
impl Clone for FragmentResource
Source§fn clone(&self) -> FragmentResource
fn clone(&self) -> FragmentResource
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FragmentResource
impl RefUnwindSafe for FragmentResource
impl Send for FragmentResource
impl Sync for FragmentResource
impl Unpin for FragmentResource
impl UnsafeUnpin for FragmentResource
impl UnwindSafe for FragmentResource
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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