pub struct VersionStore {
pub file_versions: HashMap<String, FileVersion>,
pub path: PathBuf,
}Fields§
§file_versions: HashMap<String, FileVersion>§path: PathBufImplementations§
Source§impl VersionStore
impl VersionStore
pub async fn load() -> Result<Self>
pub async fn load_from(path: PathBuf) -> Result<Self>
pub async fn save(&self) -> Result<()>
pub fn update( &mut self, url: &str, version: Vec<Version>, parents: Vec<Version>, )
Sourcepub fn update_with_hash(
&mut self,
url: &str,
version: Vec<Version>,
parents: Vec<Version>,
hash: Option<String>,
)
pub fn update_with_hash( &mut self, url: &str, version: Vec<Version>, parents: Vec<Version>, hash: Option<String>, )
Update version with content hash.
pub fn get(&self, url: &str) -> Option<&FileVersion>
Sourcepub fn get_version_by_hash(
&self,
_fullpath: &str,
hash: &str,
) -> Option<Vec<String>>
pub fn get_version_by_hash( &self, _fullpath: &str, hash: &str, ) -> Option<Vec<String>>
Get version by content hash.
Matches JS hash_to_version_cache lookup from braidfs/index.js.
Sourcepub fn set_content_hash(&mut self, url: &str, hash: String)
pub fn set_content_hash(&mut self, url: &str, hash: String)
Set content hash for a path.
Trait Implementations§
Source§impl Debug for VersionStore
impl Debug for VersionStore
Source§impl Default for VersionStore
impl Default for VersionStore
Source§fn default() -> VersionStore
fn default() -> VersionStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for VersionStore
impl<'de> Deserialize<'de> for VersionStore
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 VersionStore
impl RefUnwindSafe for VersionStore
impl Send for VersionStore
impl Sync for VersionStore
impl Unpin for VersionStore
impl UnwindSafe for VersionStore
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