pub struct AuditTrailClientReadOnly { /* private fields */ }Expand description
A read-only client for interacting with audit-trail objects on a specific network.
This is the main entry point for applications that only need package resolution and typed read
helpers. Once constructed, use Self::trail to create lightweight handles scoped to a single
trail object.
For write flows, wrap this client in crate::AuditTrailClient.
Implementations§
Source§impl AuditTrailClientReadOnly
impl AuditTrailClientReadOnly
Sourcepub const fn network(&self) -> &NetworkName
pub const fn network(&self) -> &NetworkName
Returns the name of the network the client is connected to.
Sourcepub fn chain_id(&self) -> &str
pub fn chain_id(&self) -> &str
Returns the raw chain identifier for the network this client is connected to.
Sourcepub fn package_id(&self) -> ObjectID
pub fn package_id(&self) -> ObjectID
Returns the package ID used by this client.
This is the deployed audit-trail Move package ID, not a trail object ID.
Sourcepub fn tf_components_package_id(&self) -> ObjectID
pub fn tf_components_package_id(&self) -> ObjectID
Returns the TfComponents package ID used by this client.
Sourcepub const fn iota_client(&self) -> &IotaClientAdapter
pub const fn iota_client(&self) -> &IotaClientAdapter
Returns a reference to the underlying IOTA client adapter.
Sourcepub fn trail<'a>(&'a self, trail_id: ObjectID) -> AuditTrailHandle<'a, Self>
pub fn trail<'a>(&'a self, trail_id: ObjectID) -> AuditTrailHandle<'a, Self>
Returns a typed handle bound to a specific trail object ID.
Creating the handle is cheap. Reads only happen when you call methods on the returned
AuditTrailHandle, such as AuditTrailHandle::get.
Sourcepub async fn new(iota_client: IotaClient) -> Result<Self, Error>
pub async fn new(iota_client: IotaClient) -> Result<Self, Error>
Creates a new read-only client from an IOTA client.
The package IDs are resolved from the internal registry using the connected network name. This is the recommended constructor when connecting to official deployments whose package history is already tracked by the crate.
§Errors
Returns an error if the network cannot be resolved or if the package IDs for that network cannot be determined.
Sourcepub async fn new_with_package_overrides(
iota_client: IotaClient,
package_overrides: PackageOverrides,
) -> Result<Self, Error>
pub async fn new_with_package_overrides( iota_client: IotaClient, package_overrides: PackageOverrides, ) -> Result<Self, Error>
Creates a new read-only client with explicit package-ID overrides.
This bypasses the default package-registry lookup for any IDs provided in
PackageOverrides.
Prefer this constructor when talking to custom deployments, local networks, or preview environments whose package IDs are not yet part of the built-in registry.
§Errors
Returns an error if the network cannot be resolved or if the resulting package-ID configuration is invalid.
Trait Implementations§
Source§impl Clone for AuditTrailClientReadOnly
impl Clone for AuditTrailClientReadOnly
Source§fn clone(&self) -> AuditTrailClientReadOnly
fn clone(&self) -> AuditTrailClientReadOnly
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CoreClientReadOnly for AuditTrailClientReadOnly
impl CoreClientReadOnly for AuditTrailClientReadOnly
Source§fn package_id(&self) -> ObjectID
fn package_id(&self) -> ObjectID
Source§fn tf_components_package_id(&self) -> Option<ObjectID>
fn tf_components_package_id(&self) -> Option<ObjectID>
TfComponents] package ID for this client’s network, if applicable. Read moreSource§fn network_name(&self) -> &NetworkName
fn network_name(&self) -> &NetworkName
Source§fn client_adapter(&self) -> &IotaClientAdapter
fn client_adapter(&self) -> &IotaClientAdapter
IotaClientAdapter] used by this client. Read more§fn package_history(&self) -> Vec<ObjectId>
fn package_history(&self) -> Vec<ObjectId>
§fn get_object_by_id<'life0, 'async_trait, T>(
&'life0 self,
object_id: ObjectId,
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait + DeserializeOwned,
Self: Sync + 'async_trait,
fn get_object_by_id<'life0, 'async_trait, T>(
&'life0 self,
object_id: ObjectId,
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait + DeserializeOwned,
Self: Sync + 'async_trait,
§fn get_object_ref_by_id<'life0, 'async_trait>(
&'life0 self,
object_id: ObjectId,
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedObjectRef>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn get_object_ref_by_id<'life0, 'async_trait>(
&'life0 self,
object_id: ObjectId,
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedObjectRef>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
OwnedObjectRef], if any. Read more§fn find_object_for_address<'life0, 'async_trait, T, P>(
&'life0 self,
address: Address,
predicate: P,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, Error>> + Send + 'async_trait>>
fn find_object_for_address<'life0, 'async_trait, T, P>( &'life0 self, address: Address, predicate: P, ) -> Pin<Box<dyn Future<Output = Result<Option<T>, Error>> + Send + 'async_trait>>
§fn get_iota_coins_with_at_least_balance<'life0, 'async_trait>(
&'life0 self,
owner: Address,
balance: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectReference>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
fn get_iota_coins_with_at_least_balance<'life0, 'async_trait>(
&'life0 self,
owner: Address,
balance: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectReference>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: Sync + 'async_trait,
balance. Read more§fn find_owned_ref_for_address<'life0, 'async_trait, P>(
&'life0 self,
address: Address,
tag: StructTag,
predicate: P,
) -> Pin<Box<dyn Future<Output = Result<Option<ObjectReference>, Error>> + Send + 'async_trait>>
fn find_owned_ref_for_address<'life0, 'async_trait, P>( &'life0 self, address: Address, tag: StructTag, predicate: P, ) -> Pin<Box<dyn Future<Output = Result<Option<ObjectReference>, Error>> + Send + 'async_trait>>
tag and for which predicate returns true.Auto Trait Implementations§
impl Freeze for AuditTrailClientReadOnly
impl !RefUnwindSafe for AuditTrailClientReadOnly
impl Send for AuditTrailClientReadOnly
impl Sync for AuditTrailClientReadOnly
impl Unpin for AuditTrailClientReadOnly
impl UnsafeUnpin for AuditTrailClientReadOnly
impl !UnwindSafe for AuditTrailClientReadOnly
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a Request§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.