Struct libcnb::platform::PlatformEnv [−][src]
Provides access to platform environment variables.
Implementations
impl PlatformEnv
[src]
pub fn var<K: AsRef<OsStr>>(&self, key: K) -> Result<String, VarError>
[src]
Fetches the environment variable key
from the platform.
Examples
use libcnb::platform::PlatformEnv; let env = PlatformEnv::from_path("/platform").unwrap(); let value = env.var("SOME_ENV_VAR");
pub fn from_path(platform_dir: impl AsRef<Path>) -> Result<Self, Error>
[src]
Initializes a new PlatformEnv from the given platform directory.
Buildpack authors usually do not need to create their own PlatformEnv
and instead use the
one passed via context structs (DetectContext
and BuildContext
).
Examples
use libcnb::platform::PlatformEnv; let platform = PlatformEnv::from_path("/platform").unwrap();
Auto Trait Implementations
impl RefUnwindSafe for PlatformEnv
impl Send for PlatformEnv
impl Sync for PlatformEnv
impl Unpin for PlatformEnv
impl UnwindSafe for PlatformEnv
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,
pub 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, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub 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>,