Struct warg_client::api::Client
source · pub struct Client { /* private fields */ }Expand description
Represents a Warg API client for communicating with a Warg registry server.
Implementations§
source§impl Client
impl Client
sourcepub fn url(&self) -> &RegistryUrl
pub fn url(&self) -> &RegistryUrl
Gets the URL of the API client.
sourcepub async fn latest_checkpoint(
&self
) -> Result<SerdeEnvelope<TimestampedCheckpoint>, ClientError>
pub async fn latest_checkpoint( &self ) -> Result<SerdeEnvelope<TimestampedCheckpoint>, ClientError>
Gets the latest checkpoint from the registry.
sourcepub async fn verify_checkpoint(
&self,
request: SerdeEnvelope<TimestampedCheckpoint>
) -> Result<CheckpointVerificationResponse, ClientError>
pub async fn verify_checkpoint( &self, request: SerdeEnvelope<TimestampedCheckpoint> ) -> Result<CheckpointVerificationResponse, ClientError>
Verify checkpoint of the registry.
sourcepub async fn fetch_logs(
&self,
request: FetchLogsRequest<'_>
) -> Result<FetchLogsResponse, ClientError>
pub async fn fetch_logs( &self, request: FetchLogsRequest<'_> ) -> Result<FetchLogsResponse, ClientError>
Fetches package log entries from the registry.
sourcepub async fn fetch_package_names(
&self,
request: FetchPackageNamesRequest<'_>
) -> Result<FetchPackageNamesResponse, ClientError>
pub async fn fetch_package_names( &self, request: FetchPackageNamesRequest<'_> ) -> Result<FetchPackageNamesResponse, ClientError>
Fetches package names from the registry.
sourcepub async fn ledger_sources(&self) -> Result<LedgerSourcesResponse, ClientError>
pub async fn ledger_sources(&self) -> Result<LedgerSourcesResponse, ClientError>
Gets ledger sources from the registry.
sourcepub async fn publish_package_record(
&self,
log_id: &LogId,
request: PublishRecordRequest<'_>
) -> Result<PackageRecord, ClientError>
pub async fn publish_package_record( &self, log_id: &LogId, request: PublishRecordRequest<'_> ) -> Result<PackageRecord, ClientError>
Publish a new record to a package log.
sourcepub async fn get_package_record(
&self,
log_id: &LogId,
record_id: &RecordId
) -> Result<PackageRecord, ClientError>
pub async fn get_package_record( &self, log_id: &LogId, record_id: &RecordId ) -> Result<PackageRecord, ClientError>
Gets a package record from the registry.
sourcepub async fn content_sources(
&self,
digest: &AnyHash
) -> Result<ContentSourcesResponse, ClientError>
pub async fn content_sources( &self, digest: &AnyHash ) -> Result<ContentSourcesResponse, ClientError>
Gets a content sources from the registry.
sourcepub async fn download_content(
&self,
digest: &AnyHash
) -> Result<impl Stream<Item = Result<Bytes>>, ClientError>
pub async fn download_content( &self, digest: &AnyHash ) -> Result<impl Stream<Item = Result<Bytes>>, ClientError>
Downloads the content associated with a given record.
sourcepub async fn prove_inclusion(
&self,
request: InclusionRequest,
checkpoint: &Checkpoint,
leafs: &[LogLeaf]
) -> Result<(), ClientError>
pub async fn prove_inclusion( &self, request: InclusionRequest, checkpoint: &Checkpoint, leafs: &[LogLeaf] ) -> Result<(), ClientError>
Proves the inclusion of the given package log heads in the registry.
sourcepub async fn prove_log_consistency(
&self,
request: ConsistencyRequest,
from_log_root: Cow<'_, AnyHash>,
to_log_root: Cow<'_, AnyHash>
) -> Result<(), ClientError>
pub async fn prove_log_consistency( &self, request: ConsistencyRequest, from_log_root: Cow<'_, AnyHash>, to_log_root: Cow<'_, AnyHash> ) -> Result<(), ClientError>
Proves consistency between two log roots.
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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