pub struct SystemVirtualPath(/* private fields */);Implementations§
Source§impl SystemVirtualPath
impl SystemVirtualPath
pub const fn new(path: &str) -> &SystemVirtualPath
Sourcepub fn to_path_buf(&self) -> SystemVirtualPathBuf
pub fn to_path_buf(&self) -> SystemVirtualPathBuf
Converts the path to an owned SystemVirtualPathBuf.
Sourcepub fn extension(&self) -> Option<&str>
pub fn extension(&self) -> Option<&str>
Extracts the file extension, if possible.
§Examples
use ruff_db::system::SystemVirtualPath;
assert_eq!(None, SystemVirtualPath::new("untitled:Untitled-1").extension());
assert_eq!("ipynb", SystemVirtualPath::new("untitled:Untitled-1.ipynb").extension().unwrap());
assert_eq!("ipynb", SystemVirtualPath::new("vscode-notebook-cell:Untitled-1.ipynb").extension().unwrap());See Path::extension for more details.
Trait Implementations§
Source§impl AsRef<SystemVirtualPath> for SystemVirtualPathBuf
impl AsRef<SystemVirtualPath> for SystemVirtualPathBuf
Source§fn as_ref(&self) -> &SystemVirtualPath
fn as_ref(&self) -> &SystemVirtualPath
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<SystemVirtualPath> for SystemVirtualPath
impl AsRef<SystemVirtualPath> for SystemVirtualPath
Source§fn as_ref(&self) -> &SystemVirtualPath
fn as_ref(&self) -> &SystemVirtualPath
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<SystemVirtualPath> for str
impl AsRef<SystemVirtualPath> for str
Source§fn as_ref(&self) -> &SystemVirtualPath
fn as_ref(&self) -> &SystemVirtualPath
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<SystemVirtualPath> for String
impl AsRef<SystemVirtualPath> for String
Source§fn as_ref(&self) -> &SystemVirtualPath
fn as_ref(&self) -> &SystemVirtualPath
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<SystemVirtualPath> for SystemVirtualPathBuf
impl Borrow<SystemVirtualPath> for SystemVirtualPathBuf
Source§fn borrow(&self) -> &SystemVirtualPath
fn borrow(&self) -> &SystemVirtualPath
Immutably borrows from an owned value. Read more
Source§impl Clone for Box<SystemVirtualPath>
impl Clone for Box<SystemVirtualPath>
Source§impl Debug for SystemVirtualPath
impl Debug for SystemVirtualPath
Source§impl Display for SystemVirtualPath
impl Display for SystemVirtualPath
impl Eq for SystemVirtualPath
Source§impl From<&SystemVirtualPath> for FilePath
impl From<&SystemVirtualPath> for FilePath
Source§fn from(value: &SystemVirtualPath) -> Self
fn from(value: &SystemVirtualPath) -> Self
Converts to this type from the input type.
Source§impl From<&SystemVirtualPath> for Box<SystemVirtualPath>
impl From<&SystemVirtualPath> for Box<SystemVirtualPath>
Source§fn from(path: &SystemVirtualPath) -> Self
fn from(path: &SystemVirtualPath) -> Self
Converts to this type from the input type.
Source§impl From<SystemVirtualPathBuf> for Box<SystemVirtualPath>
impl From<SystemVirtualPathBuf> for Box<SystemVirtualPath>
Source§fn from(path: SystemVirtualPathBuf) -> Self
fn from(path: SystemVirtualPathBuf) -> Self
Converts to this type from the input type.
Source§impl GetSize for Box<SystemVirtualPath>
impl GetSize for Box<SystemVirtualPath>
Source§fn get_heap_size_with_tracker<T: GetSizeTracker>(
&self,
tracker: T,
) -> (usize, T)
fn get_heap_size_with_tracker<T: GetSizeTracker>( &self, tracker: T, ) -> (usize, T)
Determines how many bytes this object occupies inside the heap while using a
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
Determines the total size of the object while using a
tracker. Read moreSource§impl Hash for SystemVirtualPath
impl Hash for SystemVirtualPath
Source§impl Ord for SystemVirtualPath
impl Ord for SystemVirtualPath
Source§impl PartialEq for SystemVirtualPath
impl PartialEq for SystemVirtualPath
Source§impl PartialOrd for SystemVirtualPath
impl PartialOrd for SystemVirtualPath
impl StructuralPartialEq for SystemVirtualPath
Auto Trait Implementations§
impl !Sized for SystemVirtualPath
impl Freeze for SystemVirtualPath
impl RefUnwindSafe for SystemVirtualPath
impl Send for SystemVirtualPath
impl Sync for SystemVirtualPath
impl Unpin for SystemVirtualPath
impl UnsafeUnpin for SystemVirtualPath
impl UnwindSafe for SystemVirtualPath
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
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.