pub struct ObsPath { /* private fields */ }
Expand description
Builds into an ObsString
that represents a path used
by libobs.
Note that only this path only supports UTF-8 for the entire absolute path because libobs only supports UTF-8.
Implementations§
Source§impl ObsPath
impl ObsPath
Sourcepub fn new(path_str: &str) -> Self
pub fn new(path_str: &str) -> Self
Creates a new ObsPath
strictly using the path
path_str
without any modifications.
If you want to create a relative path, use
ObsPath::from_relative
.
Sourcepub fn from_relative(path_str: &str) -> Self
pub fn from_relative(path_str: &str) -> Self
Creates a new ObsPath
with path_str
appended to the path of the directory which the
executable file is in.
If you want to create an absolute path, use
ObsPath::new
.
Sourcepub fn push(self, value: &str) -> Self
pub fn push(self, value: &str) -> Self
Modifies the path to point to the path
path_str
appended to the current path which
ObsPath
is pointing to.
Sourcepub fn pop(self) -> Self
pub fn pop(self) -> Self
Modifies the path to point to its current
parent. This is analogous to Obs::push(".")
.
Sourcepub fn build(self) -> ObsString
pub fn build(self) -> ObsString
Consumes the ObsPath
to create a new
immutable ObsString that encodes a UTF-8
C-type string which describes the path that
the ObsPath
is pointing to.
Note that this function is lossy in that any non-Unicode data is completely removed from the string. This is because libobs does not support non-Unicode characters in its path.
Trait Implementations§
Source§impl Ord for ObsPath
impl Ord for ObsPath
Source§impl PartialOrd for ObsPath
impl PartialOrd for ObsPath
impl Eq for ObsPath
impl StructuralPartialEq for ObsPath
Auto Trait Implementations§
impl Freeze for ObsPath
impl RefUnwindSafe for ObsPath
impl Send for ObsPath
impl Sync for ObsPath
impl Unpin for ObsPath
impl UnwindSafe for ObsPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.