[−][src]Struct libimagstore::storeid::StoreId
The Index into the Store
A StoreId object is a unique identifier for one entry in the store which might be present or not.
Methods
impl StoreId
[src]
pub fn new(base: Option<PathBuf>, id: PathBuf) -> Result<StoreId>
[src]
pub 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.
pub fn new_baseless(id: PathBuf) -> Result<StoreId>
[src]
pub fn without_base(self) -> StoreId
[src]
pub fn with_base(self, base: PathBuf) -> Self
[src]
pub fn into_pathbuf(self) -> Result<PathBuf>
[src]
Transform the StoreId object into a PathBuf, error if the base of the StoreId is not specified.
pub fn exists(&self) -> Result<bool>
[src]
Check whether the StoreId exists (as in whether the file exists)
Warning
Should be considered deprecated
pub fn to_str(&self) -> Result<String>
[src]
pub fn local_display_string(&self) -> String
[src]
Helper function for creating a displayable String from StoreId
This is safe because the
impl<T: fmt::Display + ?Sized> ToString for T
does only fail if Display::display() failed. The implementation of ::std::path::Display and the implementation ::std::fmt::Display for ::std::path::Display do not return errors though.
pub 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.
pub fn local(&self) -> &PathBuf
[src]
Get the local part of a StoreId object, as in "the part from the store root to the entry".
pub fn is_in_collection<S: AsRef<str>, V: AsRef<[S]>>(&self, colls: &V) -> 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.
pub fn local_push<P: AsRef<Path>>(&mut self, path: P)
[src]
Trait Implementations
impl IntoStoreId for StoreId
[src]
fn into_storeid(self) -> Result<StoreId>
[src]
impl PartialOrd<StoreId> for StoreId
[src]
fn partial_cmp(&self, other: &StoreId) -> Option<Ordering>
[src]
fn lt(&self, other: &StoreId) -> bool
[src]
fn le(&self, other: &StoreId) -> bool
[src]
fn gt(&self, other: &StoreId) -> bool
[src]
fn ge(&self, other: &StoreId) -> bool
[src]
impl PartialEq<StoreId> for StoreId
[src]
fn eq(&self, other: &StoreId) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl Clone for StoreId
[src]
fn clone(&self) -> StoreId
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Ord for StoreId
[src]
fn cmp(&self, other: &StoreId) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl Eq for StoreId
[src]
impl Display for StoreId
[src]
impl Debug for StoreId
[src]
impl Hash for StoreId
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,