oa::Path

An owned OA path value. Wraps std::path::PathBuf and adds the canonical OA named-location resolvers as associated functions. All std::fs calls and crate::Filesystem methods accept &oa::Path directly through Deref. ⓘlet wav = oa::Path::asset_rel("audio/oaNarration.wav"); let out = oa::Path::var_rel("example/audio/out.wav"); let ckpt = oa::Path::temp().join("model.oam");

StRust public API

Declaration

pub struct Path(/* private fields */);
Public Rust declaration.

Public Methods

pub fn into_path_buf(self) -> PathBuf
pub fn join(&self, component: impl AsRef<Path>) -> Self
pub fn parent(&self) -> Option<Self>
pub fn file_name(&self) -> Option<&OsStr>
pub fn file_stem(&self) -> Option<&OsStr>
pub fn extension(&self) -> Option<&OsStr>
pub fn with_extension(&self, ext: impl AsRef<OsStr>) -> Self
pub fn is_absolute(&self) -> bool
pub fn is_relative(&self) -> bool
pub fn is_file(&self) -> bool
pub fn is_dir(&self) -> bool
pub fn exists(&self) -> bool
pub fn display(&self) -> Display<'_>
fn as_ref(&self) -> &OsStr
fn as_ref(&self) -> &Path
fn borrow(&self) -> &Path
fn clone(&self) -> Path
fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn deref(&self) -> &Path
fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn hash<__H: Hasher>(&self, state: &mut __H)
fn cmp(&self, other: &Path) -> Ordering
fn eq(&self, other: &Path) -> bool
fn partial_cmp(&self, other: &Path) -> Option<Ordering>

Associated Functions

pub fn empty() -> Self
pub fn from_path_buf(p: PathBuf) -> Self
pub fn asset() -> Self
pub fn asset_rel(relative: impl AsRef<Path>) -> Self
pub fn var() -> Self
pub fn var_rel(relative: impl AsRef<Path>) -> Self
pub fn data() -> Self
pub fn data_rel(relative: impl AsRef<Path>) -> Self
pub fn home() -> Self
pub fn temp() -> Self
fn default() -> Path
fn from(p: &Path) -> Self
fn from(s: &str) -> Self
fn from(p: Path) -> PathBuf
fn from(p: PathBuf) -> Self
fn from(s: String) -> Self

Public Method Documentation

pub fn into_path_buf( self ) -> PathBuf
No public source comment is attached to this declaration.
pub fn join( &self, component: impl AsRef<Path> ) -> Self
No public source comment is attached to this declaration.
pub fn parent( &self ) -> Option<Self>
No public source comment is attached to this declaration.
pub fn file_name( &self ) -> Option<&OsStr>
No public source comment is attached to this declaration.
pub fn file_stem( &self ) -> Option<&OsStr>
No public source comment is attached to this declaration.
pub fn extension( &self ) -> Option<&OsStr>
No public source comment is attached to this declaration.
pub fn with_extension( &self, ext: impl AsRef<OsStr> ) -> Self
No public source comment is attached to this declaration.
pub fn is_absolute( &self ) -> bool
No public source comment is attached to this declaration.
pub fn is_relative( &self ) -> bool
No public source comment is attached to this declaration.
pub fn is_file( &self ) -> bool
No public source comment is attached to this declaration.
pub fn is_dir( &self ) -> bool
No public source comment is attached to this declaration.
pub fn exists( &self ) -> bool
No public source comment is attached to this declaration.
pub fn display( &self ) -> Display<'_>
No public source comment is attached to this declaration.
fn as_ref( &self ) -> &OsStr
No public source comment is attached to this declaration.
fn as_ref( &self ) -> &Path
No public source comment is attached to this declaration.
fn borrow( &self ) -> &Path
No public source comment is attached to this declaration.
fn clone( &self ) -> Path
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
fn deref( &self ) -> &Path
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
fn hash<__H: Hasher>( &self, state: &mut __H )
No public source comment is attached to this declaration.
fn cmp( &self, other: &Path ) -> Ordering
No public source comment is attached to this declaration.
fn eq( &self, other: &Path ) -> bool
No public source comment is attached to this declaration.
fn partial_cmp( &self, other: &Path ) -> Option<Ordering>
No public source comment is attached to this declaration.
pub fn empty() -> Self
No public source comment is attached to this declaration.
pub fn from_path_buf( p: PathBuf ) -> Self
No public source comment is attached to this declaration.
pub fn asset() -> Self
No public source comment is attached to this declaration.
pub fn asset_rel( relative: impl AsRef<Path> ) -> Self
No public source comment is attached to this declaration.
pub fn var() -> Self
No public source comment is attached to this declaration.
pub fn var_rel( relative: impl AsRef<Path> ) -> Self
No public source comment is attached to this declaration.
pub fn data() -> Self
No public source comment is attached to this declaration.
pub fn data_rel( relative: impl AsRef<Path> ) -> Self
No public source comment is attached to this declaration.
pub fn home() -> Self
No public source comment is attached to this declaration.
pub fn temp() -> Self
No public source comment is attached to this declaration.
fn default() -> Path
No public source comment is attached to this declaration.
fn from( p: &Path ) -> Self
No public source comment is attached to this declaration.
fn from( s: &str ) -> Self
No public source comment is attached to this declaration.
fn from( p: Path ) -> PathBuf
No public source comment is attached to this declaration.
fn from( p: PathBuf ) -> Self
No public source comment is attached to this declaration.
fn from( s: String ) -> Self
No public source comment is attached to this declaration.