Struct btlib::BlockPathRef
source · pub struct BlockPathRef<'a>(_);
Expand description
A reference to a block path.
BlockPathRef is to BlockPath as std::path::Path is to std::path::PathBuf.
Implementations§
source§impl<'a> BlockPathRef<'a>
impl<'a> BlockPathRef<'a>
sourcepub fn new(path: &'a str) -> StdResult<BlockPathRef<'_>, BlockPathError>
pub fn new(path: &'a str) -> StdResult<BlockPathRef<'_>, BlockPathError>
Creates a new BlockPathRef which references the path described by path
.
Methods from Deref<Target = BlockPathGen<&'a str>>§
sourcepub fn contains<U: AsRef<str>>(&self, other: &BlockPathGen<U>) -> bool
pub fn contains<U: AsRef<str>>(&self, other: &BlockPathGen<U>) -> bool
Returns true if other
is a subpath of this path.
sourcepub fn components(&self) -> Components<'_>
pub fn components(&self) -> Components<'_>
Returns an iterator over the components in this path.
sourcepub fn relative_to<'a, U: AsRef<str>>(
&'a self,
rel_to: &BlockPathGen<U>
) -> Result<RelBlockPath<'a>>
pub fn relative_to<'a, U: AsRef<str>>( &'a self, rel_to: &BlockPathGen<U> ) -> Result<RelBlockPath<'a>>
Calculates the RelBlockPath representing this path relative to rel_to
.
Trait Implementations§
source§impl<'a> Clone for BlockPathRef<'a>
impl<'a> Clone for BlockPathRef<'a>
source§fn clone(&self) -> BlockPathRef<'a>
fn clone(&self) -> BlockPathRef<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for BlockPathRef<'a>
impl<'a> Debug for BlockPathRef<'a>
source§impl<'a> Default for BlockPathRef<'a>
impl<'a> Default for BlockPathRef<'a>
source§fn default() -> BlockPathRef<'a>
fn default() -> BlockPathRef<'a>
Returns the “default value” for a type. Read more
source§impl<'a> Deref for BlockPathRef<'a>
impl<'a> Deref for BlockPathRef<'a>
source§impl<'de> Deserialize<'de> for BlockPathRef<'de>
impl<'de> Deserialize<'de> for BlockPathRef<'de>
source§fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
fn deserialize<D: Deserializer<'de>>( deserializer: D ) -> StdResult<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a> Display for BlockPathRef<'a>
impl<'a> Display for BlockPathRef<'a>
source§impl<'a> Hash for BlockPathRef<'a>
impl<'a> Hash for BlockPathRef<'a>
source§impl<'a> Ord for BlockPathRef<'a>
impl<'a> Ord for BlockPathRef<'a>
source§impl<'a> PartialEq<BlockPathRef<'a>> for BlockPathRef<'a>
impl<'a> PartialEq<BlockPathRef<'a>> for BlockPathRef<'a>
source§impl<'a> PartialOrd<BlockPathRef<'a>> for BlockPathRef<'a>
impl<'a> PartialOrd<BlockPathRef<'a>> for BlockPathRef<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<'a> Serialize for BlockPathRef<'a>
impl<'a> Serialize for BlockPathRef<'a>
source§impl<'a> TryFrom<&'a str> for BlockPathRef<'a>
impl<'a> TryFrom<&'a str> for BlockPathRef<'a>
§type Error = BlockPathError
type Error = BlockPathError
The type returned in the event of a conversion error.
source§fn try_from(string: &'a str) -> StdResult<BlockPathRef<'_>, BlockPathError>
fn try_from(string: &'a str) -> StdResult<BlockPathRef<'_>, BlockPathError>
Performs the conversion.
impl<'a> Eq for BlockPathRef<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for BlockPathRef<'a>
impl<'a> Send for BlockPathRef<'a>
impl<'a> Sync for BlockPathRef<'a>
impl<'a> Unpin for BlockPathRef<'a>
impl<'a> UnwindSafe for BlockPathRef<'a>
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