Struct libimagstore::storeid::StoreId
[−]
[src]
pub struct StoreId { /* fields omitted */ }
The Index into the Store
Methods
impl StoreId
[src]
fn new(base: Option<PathBuf>, id: PathBuf) -> Result<StoreId>
[src]
fn from_full_path<D>(store_part: &PathBuf, full_path: D) -> Result<StoreId> where
D: Deref<Target = Path>,
[src]
D: Deref<Target = Path>,
Try to create a StoreId object from a filesystem-absolute path.
Automatically creates a StoreId object which has a base
set to store_part
if stripping
the store_part
from the full_path
succeeded.
Returns a StoreErrorKind::StoreIdBuildFromFullPathError
if stripping failes.
fn new_baseless(id: PathBuf) -> Result<StoreId>
[src]
fn without_base(self) -> StoreId
[src]
fn with_base(self, base: PathBuf) -> Self
[src]
fn into_pathbuf(self) -> Result<PathBuf>
[src]
Transform the StoreId object into a PathBuf, error if the base of the StoreId is not specified.
fn exists(&self) -> Result<bool>
[src]
fn to_str(&self) -> Result<String>
[src]
fn components(&self) -> Components
[src]
Returns the components of the id
part of the StoreId object.
Can be used to check whether a StoreId points to an entry in a specific collection of StoreIds.
fn local(&self) -> &PathBuf
[src]
Get the local part of a StoreId object, as in "the part from the store root to the entry".
fn is_in_collection(&self, colls: &[&str]) -> bool
[src]
Check whether a StoreId points to an entry in a specific collection.
A "collection" here is simply a directory. So foo/bar/baz
is an entry which is in
collection ["foo", "bar", "baz"], but also in ["foo", "bar"] and ["foo"].
Warning
The collection specification has to start with the module name. Otherwise this function may return false negatives.
fn local_push<P: AsRef<Path>>(&mut self, path: P)
[src]
Trait Implementations
impl Debug for StoreId
[src]
impl Clone for StoreId
[src]
fn clone(&self) -> StoreId
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Hash for StoreId
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Eq for StoreId
[src]
impl PartialOrd for StoreId
[src]
fn partial_cmp(&self, __arg_0: &StoreId) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &StoreId) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &StoreId) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &StoreId) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &StoreId) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for StoreId
[src]
fn cmp(&self, __arg_0: &StoreId) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl PartialEq for StoreId
[src]
fn eq(&self, other: &StoreId) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Display for StoreId
[src]
fn fmt(&self, fmt: &mut Formatter) -> RResult<(), FmtError>
[src]
Formats the value using the given formatter. Read more