[−][src]Struct oceanpkg::config::RtConfig
Represents the configuration specific to this current instance.
This type exists so as to put creation of commonly-needed values up-front, allowing for errors only needed to be handled in one place.
Fields
start_time: Instant
The time at which the program started. Used for telling how much time has elapsed.
current_dir: PathBuf
The directory where this process was started from.
user_home: PathBuf
The current user's home directory.
ocean_home: LazyCell<PathBuf>
The directory for data stored for the current user.
Platform | Path |
---|---|
Linux & macOS | $HOME/.ocean |
Windows | Unimplemented |
Methods
impl RtConfig
[src]
pub fn create() -> Result<Self, CreateError>
[src]
Creates a new instance suitable for using at the start of your program.
pub fn create_at(start_time: Instant) -> Result<Self, CreateError>
[src]
Creates a new instance suitable for emitting metrics from start_time
.
pub fn time_elapsed(&self) -> Duration
[src]
Returns the amount of time elapsed since the program started.
pub fn current_dir(&self) -> &Path
[src]
The directory where this process was started from.
pub fn ocean_home(&self) -> &Path
[src]
The directory where data for the current user is stored.
pub fn user_home(&self) -> &Path
[src]
The current user's home directory.
pub fn credentials_path(&self) -> PathBuf
[src]
Returns the path for $HOME/.ocean/credentials.toml
.
pub fn bin_dir(&self) -> PathBuf
[src]
Returns the directory where binaries exposed via $PATH
are stored.
pub fn cache_dir(&self) -> PathBuf
[src]
Returns Ocean's cache directory.
pub fn tarball_cache_path(&self, query: Query<&str>) -> PathBuf
[src]
Returns the path where a tarball for query
should be cached.
pub fn drops_dir(&self, target: &InstallTarget) -> Cow<'static, Path>
[src]
Returns the directory where drops are installed.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for RtConfig
impl Send for RtConfig
impl !Sync for RtConfig
impl Unpin for RtConfig
impl UnwindSafe for RtConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,