AppRequest

Enum AppRequest 

Source
pub enum AppRequest {
    AppInfo,
    AgentInfo {
        dna_hashes: Option<Vec<DnaHash>>,
    },
    PeerMetaInfo {
        url: Url,
        dna_hashes: Option<Vec<DnaHash>>,
    },
    CallZome(Box<ZomeCallParamsSigned>),
    CreateCloneCell(Box<CreateCloneCellPayload>),
    DisableCloneCell(Box<DisableCloneCellPayload>),
    EnableCloneCell(Box<EnableCloneCellPayload>),
    DumpNetworkMetrics {
        dna_hash: Option<DnaHash>,
        include_dht_summary: bool,
    },
    DumpNetworkStats,
    ListWasmHostFunctions,
    ProvideMemproofs(MemproofMap),
    EnableApp,
}
Expand description

Represents the available conductor functions to call over an app interface and will result in a corresponding AppResponse message being sent back over the interface connection.

§Errors

Returns an AppResponse::Error with a reason why the request failed.

Variants§

§

AppInfo

Get info about the app that you are connected to, including info about each cell installed by this app.

§Returns

AppResponse::AppInfo

§

AgentInfo

Request information about the agents in this Conductor’s peer store.

This is limited to cells of the app you are connected to.

§Returns

AppResponse::AgentInfo

Fields

§dna_hashes: Option<Vec<DnaHash>>

Optionally limit the results to specific DNA hashes

§

PeerMetaInfo

Request the contents of the peer meta store(s) related to the given dna hashes for the agent at the given Url.

If dna_hashes is set to None it returns the contents for all dnas of the app.

§Returns

AppResponse::PeerMetaInfo

Fields

§url: Url
§dna_hashes: Option<Vec<DnaHash>>
§

CallZome(Box<ZomeCallParamsSigned>)

Call a zome function.

The payload to this call is composed of the serialized ZomeCallParams as bytes and the provenance’s signature.

Serialization must be performed with MessagePack. The resulting bytes are hashed using the SHA2 512-bit algorithm, and the hash is signed with the provenance’s private ed25519 key. The hash is not included in the call’s payload.

§Returns

AppResponse::ZomeCalled Indicates the zome call was deserialized successfully. If the call was authorized, the response yields the return value of the zome function as MessagePack encoded bytes. The bytes can be deserialized to the expected return type.

This response is also returned when authorization of the zome call failed because of an invalid signature, capability grant or nonce.

§Errors

SerializedBytesError is returned when the serialized bytes could not be deserialized to the expected ZomeCallParams.

§

CreateCloneCell(Box<CreateCloneCellPayload>)

Clone a DNA (in the biological sense), thus creating a new Cell.

Using the provided, already-registered DNA, create a new DNA with a unique ID and the specified properties, create a new cell from this cloned DNA, and add the cell to the specified app.

§Returns

AppResponse::CloneCellCreated

§

DisableCloneCell(Box<DisableCloneCellPayload>)

Disable a clone cell.

Providing a CloneId or CellId, disable an existing clone cell. When the clone cell exists, it is disabled and can not be called any longer. If it doesn’t exist, the call is a no-op.

§Returns

AppResponse::CloneCellDisabled if the clone cell existed and has been disabled.

§

EnableCloneCell(Box<EnableCloneCellPayload>)

Enable a clone cell that was previously disabled.

§Returns

AppResponse::CloneCellEnabled

§

DumpNetworkMetrics

Retrieve network metrics for the current app.

Identical to what AdminRequest::DumpNetworkMetrics does, but scoped to the current app.

If dna_hash is not set, metrics for all DNAs in the current app are returned.

§Returns

AppResponse::NetworkMetricsDumped

Fields

§dna_hash: Option<DnaHash>

If set, limits the metrics dumped to a single DNA hash space.

§include_dht_summary: bool

Whether to include a DHT summary.

You need a dump from multiple nodes in order to make a comparison, so this is not requested by default.

§

DumpNetworkStats

Dump network statistics from the Kitsune2 networking transport module.

Identical to what AdminRequest::DumpNetworkStats does, but scoped to the current app. Connections that are not relevant to a DNA in the current app are filtered out.

§Returns

AppResponse::NetworkStatsDumped

§

ListWasmHostFunctions

List all host functions available to wasm on this conductor.

§Returns

AppResponse::ListWasmHostFunctions

§

ProvideMemproofs(MemproofMap)

Provide the membrane proofs for this app, if this app was installed using allow_deferred_memproofs and memproofs were not provided at installation time.

§Returns

AppResponse::Ok

§

EnableApp

Enable the app, only in special circumstances. Can only be called while the app is in the Disabled(NotStartedAfterProvidingMemproofs) state. Cannot be used to enable the app if it’s in any other state, or Disabled for any other reason.

§Returns

AppResponse::Ok

Trait Implementations§

Source§

impl Clone for AppRequest

Source§

fn clone(&self) -> AppRequest

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AppRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AppRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AppRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<&AppRequest> for SerializedBytes

Source§

type Error = SerializedBytesError

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

fn try_from(t: &AppRequest) -> Result<SerializedBytes, SerializedBytesError>

Performs the conversion.
Source§

impl TryFrom<AppRequest> for SerializedBytes

Source§

type Error = SerializedBytesError

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

fn try_from(t: AppRequest) -> Result<SerializedBytes, SerializedBytesError>

Performs the conversion.
Source§

impl TryFrom<SerializedBytes> for AppRequest

Source§

type Error = SerializedBytesError

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

fn try_from(sb: SerializedBytes) -> Result<AppRequest, SerializedBytesError>

Performs the conversion.

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,