Trait libimagentryref::reference::Ref
source · pub trait Ref {
fn is_ref(&self) -> Result<bool>;
fn get_hash(&self) -> Result<&str>;
fn make_ref<P: AsRef<Path>>(&mut self, hash: String, path: P) -> Result<()>;
fn get_path(&self) -> Result<PathBuf>;
fn hash_valid<RPG: UniqueRefPathGenerator>(&self) -> Result<bool>;
fn remove_ref(&mut self) -> Result<()>;
fn is_ref_to_file(&self) -> Result<bool> { ... }
fn is_ref_to_dir(&self) -> Result<bool> { ... }
fn is_dangling(&self) -> Result<bool> { ... }
}
Required Methods
sourcefn get_hash(&self) -> Result<&str>
fn get_hash(&self) -> Result<&str>
Get the stored hash.
Does not need a UniqueRefPathGenerator
as it reads the hash stored in the header
sourcefn make_ref<P: AsRef<Path>>(&mut self, hash: String, path: P) -> Result<()>
fn make_ref<P: AsRef<Path>>(&mut self, hash: String, path: P) -> Result<()>
Make this object a ref
sourcefn get_path(&self) -> Result<PathBuf>
fn get_path(&self) -> Result<PathBuf>
Get the referenced path.
Does not need a UniqueRefPathGenerator
as it reads the path stored in the header.
sourcefn hash_valid<RPG: UniqueRefPathGenerator>(&self) -> Result<bool>
fn hash_valid<RPG: UniqueRefPathGenerator>(&self) -> Result<bool>
Check whether the referenced file still matches its hash
fn remove_ref(&mut self) -> Result<()>
Provided Methods
sourcefn is_ref_to_file(&self) -> Result<bool>
fn is_ref_to_file(&self) -> Result<bool>
Alias for r.fs_link_exists() && r.deref().is_file()
sourcefn is_ref_to_dir(&self) -> Result<bool>
fn is_ref_to_dir(&self) -> Result<bool>
Alias for r.fs_link_exists() && r.deref().is_dir()
sourcefn is_dangling(&self) -> Result<bool>
fn is_dangling(&self) -> Result<bool>
Alias for !Ref::fs_link_exists()