pub struct ConfigOps;Expand description
ConfigOps
Ops-layer façade for configuration access.
Responsibilities:
- Provide fallible lookups over the configuration model (
try_get_*) - Provide infallible access to the current subnet/canister context, assuming environment initialization has completed
Implementations§
Source§impl ConfigOps
impl ConfigOps
Sourcepub fn try_get_subnet(role: &SubnetRole) -> Result<SubnetConfig, Error>
pub fn try_get_subnet(role: &SubnetRole) -> Result<SubnetConfig, Error>
Fetch a subnet configuration by role.
Sourcepub fn try_get_canister(
subnet_role: &SubnetRole,
canister_role: &CanisterRole,
) -> Result<CanisterConfig, Error>
pub fn try_get_canister( subnet_role: &SubnetRole, canister_role: &CanisterRole, ) -> Result<CanisterConfig, Error>
Fetch a canister configuration within a specific subnet.
Sourcepub fn current_subnet() -> SubnetConfig
pub fn current_subnet() -> SubnetConfig
Fetch the configuration record for the current subnet.
§Panics
- If the environment has not been initialized
- If the subnet is missing from the configuration
Sourcepub fn current_canister() -> CanisterConfig
pub fn current_canister() -> CanisterConfig
Fetch the configuration record for the current canister.
§Panics
- If the environment has not been initialized
- If the canister is missing from the configuration
Sourcepub fn current_subnet_canister(canister_role: &CanisterRole) -> CanisterConfig
pub fn current_subnet_canister(canister_role: &CanisterRole) -> CanisterConfig
Fetch the configuration for a specific canister in the current subnet.
§Panics
- If the environment has not been initialized
- If the canister is missing from the configuration
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