Skip to main content

RpcApi

Struct RpcApi 

Source
pub struct RpcApi;
Expand description

RpcApi

Public, user-callable wrappers for Canic’s internal RPC workflows.

These functions:

  • form part of the public API surface
  • are safe to call from downstream canister lib.rs code
  • return Error suitable for IC boundaries

Internally, they delegate to workflow-level RPC implementations, preserving the layering:

user canister -> api -> workflow -> ops -> infra

Workflow preserves typed internal failures; conversion to Error happens exclusively at this API boundary.

Implementations§

Source§

impl RpcApi

Source

pub async fn response_capability_v1_root( envelope: RootCapabilityEnvelopeV1, authority: RootCapabilityAuthority, lifecycle: &dyn RootCapabilityLifecycleExecutor, ) -> Result<RootCapabilityResponseV1, Error>

Dispatch the full root capability envelope verifier/orchestrator path.

Source

pub async fn response_capability_v1_nonroot( envelope: NonrootCyclesCapabilityEnvelopeV1, ) -> Result<NonrootCyclesCapabilityResponseV1, Error>

Dispatch the non-root structural cycles capability path.

Source

pub async fn create_canister_request<A>( operation_id: [u8; 32], canister_role: &CanisterRole, parent: CreateCanisterParent, extra: Option<A>, ) -> Result<CreateCanisterResponse, Error>
where A: CandidType + Send + Sync,

Request one role-admitted direct child through the local Fleet Subnet Root.

The application must durably allocate a nonzero operation_id before calling and reuse that exact identity after an interrupted or uncertain result. Reusing the identity with a different request is rejected.

Source

pub async fn request_cycles(cycles: u128) -> Result<CyclesResponse, Error>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.