Struct ra_ap_base_db::VfsPath [−][src]
pub struct VfsPath(_);
Expand description
Path in Vfs
.
Long-term, we want to support files which do not reside in the file-system,
so we treat VfsPath
s as opaque identifiers.
Implementations
impl VfsPath
[src]
impl VfsPath
[src]pub fn new_virtual_path(path: String) -> VfsPath
[src]
pub fn new_virtual_path(path: String) -> VfsPath
[src]Creates an “in-memory” path from /
-separated string.
This is most useful for testing, to avoid windows/linux differences
Panics
Panics if path
does not start with '/'
.
pub fn as_path(&self) -> Option<&AbsPath>
[src]
pub fn as_path(&self) -> Option<&AbsPath>
[src]Returns the AbsPath
representation of self
if self
is on the file system.
pub fn join(&self, path: &str) -> Option<VfsPath>
[src]
pub fn join(&self, path: &str) -> Option<VfsPath>
[src]Creates a new VfsPath
with path
adjoined to self
.
pub fn pop(&mut self) -> bool
[src]
pub fn pop(&mut self) -> bool
[src]Remove the last component of self
if there is one.
If self
has no component, returns false
; else returns true
.
Example
let mut path = VfsPath::from(AbsPathBuf::assert("/foo/bar".into())); assert!(path.pop()); assert_eq!(path, VfsPath::from(AbsPathBuf::assert("/foo".into()))); assert!(path.pop()); assert_eq!(path, VfsPath::from(AbsPathBuf::assert("/".into()))); assert!(!path.pop());
pub fn starts_with(&self, other: &VfsPath) -> bool
[src]
pub fn starts_with(&self, other: &VfsPath) -> bool
[src]Returns true
if other
is a prefix of self
.
Trait Implementations
impl Ord for VfsPath
[src]
impl Ord for VfsPath
[src]impl PartialOrd<VfsPath> for VfsPath
[src]
impl PartialOrd<VfsPath> for VfsPath
[src]pub fn partial_cmp(&self, other: &VfsPath) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &VfsPath) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for VfsPath
[src]
impl StructuralEq for VfsPath
[src]
impl StructuralPartialEq for VfsPath
[src]
Auto Trait Implementations
impl RefUnwindSafe for VfsPath
impl Send for VfsPath
impl Sync for VfsPath
impl Unpin for VfsPath
impl UnwindSafe for VfsPath
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more