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 export_toml() -> Result<String, Error>
pub fn export_toml() -> Result<String, Error>
Export the full current configuration as TOML.
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.
pub fn get() -> Result<Arc<ConfigModel>, Error>
pub fn controllers() -> Result<Vec<Principal>, Error>
pub fn log_config() -> Result<LogConfig, Error>
Sourcepub fn current_subnet() -> Result<SubnetConfig, Error>
pub fn current_subnet() -> Result<SubnetConfig, Error>
Fetch the configuration record for the current subnet.
Sourcepub fn current_canister() -> Result<CanisterConfig, Error>
pub fn current_canister() -> Result<CanisterConfig, Error>
Fetch the configuration record for the current canister.
Sourcepub fn current_scaling_config() -> Result<Option<ScalingConfig>, Error>
pub fn current_scaling_config() -> Result<Option<ScalingConfig>, Error>
Fetch the scaling configuration for the current canister.
Sourcepub fn current_subnet_canister(
canister_role: &CanisterRole,
) -> Result<CanisterConfig, Error>
pub fn current_subnet_canister( canister_role: &CanisterRole, ) -> Result<CanisterConfig, Error>
Fetch the configuration for a specific canister in the current subnet.
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