pub struct ConfigOps;Expand description
ConfigOps
Ops-layer façade for configuration access.
Responsibilities:
- Provide fallible lookups over the config model (
try_get_subnet,try_get_canister). - Provide “current context” helpers (
cfg_current_subnet,cfg_current_canister) that combineEnvOps(who am I?) with the static configuration model.
Implementations§
Source§impl ConfigOps
impl ConfigOps
Sourcepub fn try_get_subnet(ty: &SubnetRole) -> Result<SubnetConfig, Error>
pub fn try_get_subnet(ty: &SubnetRole) -> Result<SubnetConfig, Error>
Fetch a subnet configuration by type.
Sourcepub fn try_get_canister(
subnet_type: &SubnetRole,
canister_type: &CanisterRole,
) -> Result<CanisterConfig, Error>
pub fn try_get_canister( subnet_type: &SubnetRole, canister_type: &CanisterRole, ) -> Result<CanisterConfig, Error>
Get a canister configuration inside a specific subnet.
Sourcepub fn current_subnet() -> Result<SubnetConfig, Error>
pub fn current_subnet() -> Result<SubnetConfig, Error>
Fetch the configuration record for the current subnet.
pub fn current_canister() -> Result<CanisterConfig, Error>
pub fn current_subnet_canister( canister_type: &CanisterRole, ) -> Result<CanisterConfig, Error>
Auto Trait Implementations§
impl Freeze for ConfigOps
impl RefUnwindSafe for ConfigOps
impl Send for ConfigOps
impl Sync for ConfigOps
impl Unpin for ConfigOps
impl UnwindSafe for ConfigOps
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
Mutably borrows from an owned value. Read more