pub struct AdminClient { /* private fields */ }Expand description
A client for Canton’s Ledger-API admin services: PartyManagementService
and UserManagementService.
Served on the Ledger API port (e.g. :3901) — the same endpoint and auth as
canton_ledger. Party-management RPCs require the ParticipantAdmin
right; the current_user* self-inspect calls do not.
Implementations§
Source§impl AdminClient
impl AdminClient
Sourcepub fn connect_lazy(config: Config) -> Result<Self>
pub fn connect_lazy(config: Config) -> Result<Self>
Build a lazily-connected client. Returns immediately; the TCP/TLS handshake happens on the first RPC.
§Errors
Returns Error::InvalidRequest if the endpoint is not a valid URI.
Sourcepub async fn participant_id(&self) -> Result<String>
pub async fn participant_id(&self) -> Result<String>
Sourcepub async fn allocate_party(
&self,
party_id_hint: Option<&str>,
) -> Result<PartyDetails>
pub async fn allocate_party( &self, party_id_hint: Option<&str>, ) -> Result<PartyDetails>
Allocate a new party (AllocateParty). party_id_hint suggests the
local part of the party id; the participant returns the actual
PartyDetails (party = "<hint>::<fingerprint>").
Requires the ParticipantAdmin right. Not retried: party allocation is
a non-idempotent topology mutation (a lost response must not double
allocate), so a transient failure surfaces to the caller.
§Errors
Returns an Error if authentication/authorization fails, the RPC
fails, or the response carries no party details.
Sourcepub async fn list_known_parties_page(
&self,
page_size: i32,
page_token: Option<String>,
) -> Result<(Vec<PartyDetails>, Option<String>)>
pub async fn list_known_parties_page( &self, page_size: i32, page_token: Option<String>, ) -> Result<(Vec<PartyDetails>, Option<String>)>
Sourcepub async fn list_known_parties(&self) -> Result<Vec<PartyDetails>>
pub async fn list_known_parties(&self) -> Result<Vec<PartyDetails>>
Sourcepub async fn get_parties(
&self,
parties: Vec<String>,
) -> Result<Vec<PartyDetails>>
pub async fn get_parties( &self, parties: Vec<String>, ) -> Result<Vec<PartyDetails>>
Sourcepub async fn current_user(&self) -> Result<User>
pub async fn current_user(&self) -> Result<User>
Sourcepub async fn current_user_rights(&self) -> Result<Vec<Right>>
pub async fn current_user_rights(&self) -> Result<Vec<Right>>
Sourcepub async fn list_packages(&self) -> Result<Vec<String>>
pub async fn list_packages(&self) -> Result<Vec<String>>
Sourcepub async fn get_package_status(
&self,
package_id: &str,
) -> Result<PackageStatus>
pub async fn get_package_status( &self, package_id: &str, ) -> Result<PackageStatus>
Sourcepub async fn acting_parties(&self) -> Result<Vec<String>>
pub async fn acting_parties(&self) -> Result<Vec<String>>
The specific parties the authenticated user may act as — the CanActAs
subset of Self::current_user_rights. Supersedes the ad-hoc party
discovery used in early tests.
Note: a user granted the wildcard CanActAsAnyParty right may act as
any party yet carries no explicit CanActAs entries, so this returns
an empty list for such users — an empty result means “no specific
parties”, not necessarily “cannot act”. Inspect
Self::current_user_rights directly if you need the wildcard.
§Errors
Returns an Error if the underlying rights RPC fails.
Trait Implementations§
Source§impl Clone for AdminClient
impl Clone for AdminClient
Source§fn clone(&self) -> AdminClient
fn clone(&self) -> AdminClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AdminClient
impl !UnwindSafe for AdminClient
impl Freeze for AdminClient
impl Send for AdminClient
impl Sync for AdminClient
impl Unpin for AdminClient
impl UnsafeUnpin for AdminClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request