pub struct Manifest {
pub schema_version: String,
pub roots: HashMap<String, RootInfo>,
pub files: HashMap<String, ManifestEntry>,
pub partitions: HashMap<String, String>,
}Expand description
Manifest that maps files to partitions
Fields§
§schema_version: StringSchema version for compatibility
roots: HashMap<String, RootInfo>Map from root name to root info (multi-root support)
files: HashMap<String, ManifestEntry>Map from file path to manifest entry
partitions: HashMap<String, String>Map from partition ID to partition file name
Implementations§
Source§impl Manifest
impl Manifest
Sourcepub fn load(path: &Path) -> Result<Self, LazyGraphError>
pub fn load(path: &Path) -> Result<Self, LazyGraphError>
Load manifest from a JSON file
Sourcepub fn get_partition_for_file(&self, file: &str) -> Option<&str>
pub fn get_partition_for_file(&self, file: &str) -> Option<&str>
Get the partition ID for a file
Sourcepub fn get_partition_file(&self, partition_id: &str) -> Option<&str>
pub fn get_partition_file(&self, partition_id: &str) -> Option<&str>
Get the partition database file name
Sourcepub fn set_file(
&mut self,
file: String,
partition_id: String,
content_hash: Option<String>,
)
pub fn set_file( &mut self, file: String, partition_id: String, content_hash: Option<String>, )
Add or update a file entry
Sourcepub fn register_partition(&mut self, partition_id: String, filename: String)
pub fn register_partition(&mut self, partition_id: String, filename: String)
Register a partition
Sourcepub fn register_root(&mut self, root_info: RootInfo)
pub fn register_root(&mut self, root_info: RootInfo)
Register a root
Sourcepub fn root_names(&self) -> impl Iterator<Item = &str>
pub fn root_names(&self) -> impl Iterator<Item = &str>
Get all root names
Sourcepub fn is_multi_root(&self) -> bool
pub fn is_multi_root(&self) -> bool
Check if this is a multi-root workspace
Sourcepub fn root_count(&self) -> usize
pub fn root_count(&self) -> usize
Get the number of roots
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Manifest
impl<'de> Deserialize<'de> for Manifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Manifest
impl RefUnwindSafe for Manifest
impl Send for Manifest
impl Sync for Manifest
impl Unpin for Manifest
impl UnwindSafe for Manifest
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