pub enum EffectiveId {
Canister(Principal),
Subnet(Principal),
}Expand description
The effective ID that routes a request to a particular endpoint shape.
Most calls target a canister and are routed via an
effective canister id.
A small set of management-canister calls (currently create_canister,
provisional_create_canister_with_cycles, and list_canisters) are instead
routed via an effective subnet id,
targeting the subnet-scoped HTTP endpoints (/api/v4/subnet/<id>/call,
/api/v3/subnet/<id>/read_state, /api/v3/subnet/<id>/query).
Principal converts into EffectiveId::Canister(_), so passing a bare
Principal to APIs that accept impl Into<EffectiveId> preserves the
canister-scoped behavior of earlier ic-agent releases.
Variants§
Canister(Principal)
An effective canister id. The request is routed to the canister-scoped HTTP endpoints.
Subnet(Principal)
An effective subnet id. The request is routed to the subnet-scoped HTTP endpoints.
Implementations§
Source§impl EffectiveId
impl EffectiveId
Sourcepub fn as_principal(&self) -> Principal
pub fn as_principal(&self) -> Principal
Returns the underlying principal regardless of variant.
Trait Implementations§
Source§impl Clone for EffectiveId
impl Clone for EffectiveId
Source§fn clone(&self) -> EffectiveId
fn clone(&self) -> EffectiveId
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EffectiveId
impl Debug for EffectiveId
Source§impl From<Principal> for EffectiveId
impl From<Principal> for EffectiveId
Source§impl Hash for EffectiveId
impl Hash for EffectiveId
Source§impl PartialEq for EffectiveId
impl PartialEq for EffectiveId
Source§fn eq(&self, other: &EffectiveId) -> bool
fn eq(&self, other: &EffectiveId) -> bool
self and other values to be equal, and is used by ==.impl Copy for EffectiveId
impl Eq for EffectiveId
impl StructuralPartialEq for EffectiveId
Auto Trait Implementations§
impl Freeze for EffectiveId
impl RefUnwindSafe for EffectiveId
impl Send for EffectiveId
impl Sync for EffectiveId
impl Unpin for EffectiveId
impl UnsafeUnpin for EffectiveId
impl UnwindSafe for EffectiveId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.