holochain_client

Struct AdminWebsocket

Source
pub struct AdminWebsocket { /* private fields */ }

Implementations§

Source§

impl AdminWebsocket

Source

pub async fn connect(socket_addr: impl ToSocketAddrs) -> Result<Self>

Connect to a Conductor API AdminWebsocket.

socket_addr is a websocket address that implements ToSocketAddr. See trait ToSocketAddr.

§Examples
use std::net::Ipv4Addr;
let admin_ws = holochain_client::AdminWebsocket::connect((Ipv4Addr::LOCALHOST, 30_000)).await?;

As string "localhost:30000" As tuple ([127.0.0.1], 30000)

Source

pub async fn connect_with_config( socket_addr: impl ToSocketAddrs, websocket_config: Arc<WebsocketConfig>, ) -> Result<Self>

Connect to a Conductor API AdminWebsocket with a custom WebsocketConfig.

Source

pub async fn issue_app_auth_token( &self, payload: IssueAppAuthenticationTokenPayload, ) -> ConductorApiResult<AppAuthenticationTokenIssued>

Issue an app authentication token for the specified app.

A token is required to create an [AppAgentWebsocket] connection.

Source

pub async fn generate_agent_pub_key(&self) -> ConductorApiResult<AgentPubKey>

Source

pub async fn revoke_agent_key( &self, app_id: String, agent_key: AgentPubKey, ) -> ConductorApiResult<Vec<(CellId, String)>>

Source

pub async fn list_app_interfaces( &self, ) -> ConductorApiResult<Vec<AppInterfaceInfo>>

List all app interfaces attached to the conductor.

See the documentation for AdminWebsocket::attach_app_interface to understand the content of AppInterfaceInfo and help you to select an appropriate interface to connect to.

Source

pub async fn attach_app_interface( &self, port: u16, allowed_origins: AllowedOrigins, installed_app_id: Option<String>, ) -> ConductorApiResult<u16>

Attach an app interface to the conductor.

This will create a new websocket on the specified port. Alternatively, specify the port as 0 to allow the OS to choose a port. The selected port will be returned so you know where to connect your app client.

Allowed origins can be used to restrict which domains can connect to the interface. This is used to protect the interface from scripts running in web pages. In development it is acceptable to use AllowedOrigins::All to allow all connections. In production you should consider setting an explicit list of origins, such as "my_cli_app".to_string().into().

If you want to restrict this app interface so that it is only accessible to a specific installed app then you can provide the installed_app_id. The client will still need to authenticate with a valid token for the same app, but clients for other apps will not be able to connect. If you want to allow all apps to connect then set this to None.

Source

pub async fn list_apps( &self, status_filter: Option<AppStatusFilter>, ) -> ConductorApiResult<Vec<AppInfo>>

Source

pub async fn install_app( &self, payload: InstallAppPayload, ) -> ConductorApiResult<AppInfo>

Source

pub async fn uninstall_app( &self, installed_app_id: String, force: bool, ) -> ConductorApiResult<()>

Source

pub async fn enable_app( &self, installed_app_id: String, ) -> ConductorApiResult<EnableAppResponse>

Source

pub async fn disable_app( &self, installed_app_id: String, ) -> ConductorApiResult<()>

Source

pub async fn list_cell_ids(&self) -> ConductorApiResult<Vec<CellId>>

Source

pub async fn get_dna_definition( &self, hash: DnaHash, ) -> ConductorApiResult<DnaDef>

Source

pub async fn get_compatible_cells( &self, dna_hash: DnaHash, ) -> ConductorApiResult<CompatibleCells>

Source

pub async fn grant_zome_call_capability( &self, payload: GrantZomeCallCapabilityPayload, ) -> ConductorApiResult<()>

Source

pub async fn delete_clone_cell( &self, payload: DeleteCloneCellPayload, ) -> ConductorApiResult<()>

Source

pub async fn storage_info(&self) -> ConductorApiResult<StorageInfo>

Source

pub async fn dump_network_stats(&self) -> ConductorApiResult<String>

Source

pub async fn update_coordinators( &self, update_coordinators_payload: UpdateCoordinatorsPayload, ) -> ConductorApiResult<()>

Source

pub async fn graft_records( &self, cell_id: CellId, validate: bool, records: Vec<Record>, ) -> ConductorApiResult<()>

Source

pub async fn agent_info( &self, cell_id: Option<CellId>, ) -> ConductorApiResult<Vec<AgentInfoSigned>>

Source

pub async fn add_agent_info( &self, agent_infos: Vec<AgentInfoSigned>, ) -> ConductorApiResult<()>

Source

pub async fn authorize_signing_credentials( &self, request: AuthorizeSigningCredentialsPayload, ) -> Result<SigningCredentials>

Trait Implementations§

Source§

impl Drop for AdminWebsocket

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> 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> 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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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> 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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T