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.