Skip to main content

AppRequest

Enum AppRequest 

Source
pub enum AppRequest {
Show 14 variants AppInfo, AgentInfo { dna_hashes: Option<Vec<HoloHash<Dna>>>, }, PeerMetaInfo { url: Url, dna_hashes: Option<Vec<HoloHash<Dna>>>, }, CallZome(Box<ZomeCallParamsSigned>), CreateCloneCell(Box<CreateCloneCellPayload>), DisableCloneCell(Box<DisableCloneCellPayload>), EnableCloneCell(Box<DisableCloneCellPayload>), DumpOpTimings { dna_hash: HoloHash<Dna>, cursor: Option<OpTimingsCursor>, limit: Option<u32>, }, DumpNetworkMetrics { dna_hash: Option<HoloHash<Dna>>, include_dht_summary: bool, }, DumpNetworkStats, ListWasmHostFunctions, ProvideMemproofs(HashMap<String, Arc<SerializedBytes>>), EnableApp, SendDirectSignal { dna_hash: HoloHash<Dna>, agents: Vec<HoloHash<Agent>>, signal: Vec<u8>, },
}
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<HoloHash<Dna>>>

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<HoloHash<Dna>>>
§

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<DisableCloneCellPayload>)

Enable a clone cell that was previously disabled.

§Returns

AppResponse::CloneCellEnabled

§

DumpOpTimings

Dump the lifecycle timings of the DHT ops held by this conductor for the DNA of one of this app’s cells.

Identical to AdminRequest::DumpOpTimings except that dna_hash must be the DNA of a cell of the app this connection is authenticated for. As there, the DHT database is shared by every cell running the same DNA, so the dump covers the whole DHT arc this conductor is currently holding for that DNA, not the ops of any one agent running the DNA.

§Returns

AppResponse::OpTimingsDumped

Fields

§dna_hash: HoloHash<Dna>

The DNA whose DHT arc to dump op timings for. This app must run a cell of this DNA.

§cursor: Option<OpTimingsCursor>

Pagination cursor from a previous DumpOpTimings; only ops ordered strictly after it are returned. None starts from the beginning.

§limit: Option<u32>

Maximum number of ops to return. Must be greater than zero.

§

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<HoloHash<Dna>>

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(HashMap<String, Arc<SerializedBytes>>)

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

§

SendDirectSignal

Send a remote signal directly to one or more peers.

Using this app request is equivalent to calling a zome function that forwards to the HDK function send_remote_signal. On the receiving end, the conductor does not call the corresponding zome’s recv_remote_signal function, which would then have to invoke the HDK function emit_signal. The result is that signals can be exchanged between peers without having to run a WASM function on each side.

Note that this bypasses the usual security mechanism where zomes must create a capability grant to permit recv_remote_signal to be invoked without restriction.

Fields

§dna_hash: HoloHash<Dna>

The app network to send messages on.

§agents: Vec<HoloHash<Agent>>

The agents to send the signal payload to.

An empty payload is treated as an error.

§signal: Vec<u8>

The signal payload.

Treated as opaque by Holochain, it is up to the application to decide how to serialize, deserialize and process payloads.

Trait Implementations§

Source§

impl Clone for AppRequest

Source§

fn clone(&self) -> AppRequest

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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<(), Error>

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

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

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<AppRequest, <__D as Deserializer<'de>>::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 as Serializer>::Ok, <__S as Serializer>::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> Any for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> AnySync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> 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> 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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> 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<T> Upcastable for T
where T: Any + Send + Sync + 'static,

Source§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
Source§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
Source§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
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> 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