pub struct AppWebsocket {
pub my_pub_key: AgentPubKey,
/* private fields */
}
Fields§
§my_pub_key: AgentPubKey
Implementations§
Source§impl AppWebsocket
impl AppWebsocket
Sourcepub async fn connect(
socket_addr: impl ToSocketAddrs,
token: AppAuthenticationToken,
signer: Arc<dyn AgentSigner + Send + Sync>,
) -> Result<Self>
pub async fn connect( socket_addr: impl ToSocketAddrs, token: AppAuthenticationToken, signer: Arc<dyn AgentSigner + Send + Sync>, ) -> Result<Self>
Connect to a Conductor API AppWebsocket with a specific app id.
socket_addr
is a websocket address that implements ToSocketAddr
.
See trait ToSocketAddr
.
§Examples
use std::net::Ipv4Addr;
let mut admin_ws = holochain_client::AdminWebsocket::connect((Ipv4Addr::LOCALHOST, 30_000)).await?;
let app_id = "test-app".to_string();
let issued = admin_ws.issue_app_auth_token(app_id.clone().into()).await.unwrap();
let signer = holochain_client::ClientAgentSigner::default();
let app_ws = holochain_client::AppWebsocket::connect((Ipv4Addr::LOCALHOST, 30_001), issued.token, signer.into()).await?;
As string "localhost:30000"
As tuple ([127.0.0.1], 30000)
pub async fn on_signal<F: Fn(Signal) + 'static + Sync + Send>( &self, handler: F, ) -> Result<String>
pub async fn app_info(&self) -> ConductorApiResult<Option<AppInfo>>
pub async fn call_zome( &self, target: ZomeCallTarget, zome_name: ZomeName, fn_name: FunctionName, payload: ExternIO, ) -> ConductorApiResult<ExternIO>
pub async fn signed_call_zome( &self, signed_params: ZomeCallParamsSigned, ) -> ConductorApiResult<ExternIO>
pub async fn provide_memproofs( &self, memproofs: MemproofMap, ) -> ConductorApiResult<()>
pub async fn enable_app(&self) -> ConductorApiResult<()>
pub async fn create_clone_cell( &self, msg: CreateCloneCellPayload, ) -> ConductorApiResult<ClonedCell>
pub async fn disable_clone_cell( &self, payload: DisableCloneCellPayload, ) -> ConductorApiResult<()>
pub async fn enable_clone_cell( &self, payload: EnableCloneCellPayload, ) -> ConductorApiResult<ClonedCell>
pub async fn network_info( &self, payload: NetworkInfoRequestPayload, ) -> ConductorApiResult<Vec<NetworkInfo>>
pub async fn list_wasm_host_functions(&self) -> ConductorApiResult<Vec<String>>
Sourcepub async fn refresh_app_info(&mut self) -> Result<()>
pub async fn refresh_app_info(&mut self) -> Result<()>
Gets a new copy of the AppInfo for the app this agent is connected to.
This is useful if you have made changes to the app, such as creating new clone cells, and need to refresh the app info.
Trait Implementations§
Source§impl Clone for AppWebsocket
impl Clone for AppWebsocket
Source§fn clone(&self) -> AppWebsocket
fn clone(&self) -> AppWebsocket
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AppWebsocket
impl !RefUnwindSafe for AppWebsocket
impl Send for AppWebsocket
impl Sync for AppWebsocket
impl Unpin for AppWebsocket
impl !UnwindSafe for AppWebsocket
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.