pub struct ApiClient { /* private fields */ }Implementations§
Source§impl ApiClient
Currently only GetJobStatus and VerifyClass are public available apis.
In the future, the get class api should be moved to using public apis too.
TODO: Change get class api to use public apis.
impl ApiClient
Currently only GetJobStatus and VerifyClass are public available apis.
In the future, the get class api should be moved to using public apis too.
TODO: Change get class api to use public apis.
Sourcepub fn new(base: Url) -> Result<Self, ApiClientError>
pub fn new(base: Url) -> Result<Self, ApiClientError>
§Errors
Fails if provided Url cannot be a base. We rely on that
invariant in other methods.
Sourcepub fn get_class_url(
&self,
class_hash: &ClassHash,
) -> Result<Url, ApiClientError>
pub fn get_class_url( &self, class_hash: &ClassHash, ) -> Result<Url, ApiClientError>
§Errors
Will return Err if the URL cannot be a base.
Sourcepub fn get_class(&self, class_hash: &ClassHash) -> Result<bool, ApiClientError>
pub fn get_class(&self, class_hash: &ClassHash) -> Result<bool, ApiClientError>
§Errors
Returns Err if the required class_hash is not found or on
network failure.
Sourcepub fn verify_class_url(
&self,
class_hash: &ClassHash,
) -> Result<Url, ApiClientError>
pub fn verify_class_url( &self, class_hash: &ClassHash, ) -> Result<Url, ApiClientError>
§Errors
Will return Err if the URL cannot be a base.
Sourcepub fn verify_class(
&self,
class_hash: &ClassHash,
license: Option<String>,
name: &str,
project_metadata: ProjectMetadataInfo,
files: &[FileInfo],
) -> Result<String, ApiClientError>
pub fn verify_class( &self, class_hash: &ClassHash, license: Option<String>, name: &str, project_metadata: ProjectMetadataInfo, files: &[FileInfo], ) -> Result<String, ApiClientError>
§Errors
Will return Err on network request failure or if can’t
gather file contents for submission.
Sourcepub fn get_job_status_url(
&self,
job_id: impl AsRef<str>,
) -> Result<Url, ApiClientError>
pub fn get_job_status_url( &self, job_id: impl AsRef<str>, ) -> Result<Url, ApiClientError>
§Errors
Will return Err if the URL cannot be a base.
Sourcepub fn get_job_status(
&self,
job_id: impl Into<String> + Clone,
) -> Result<Option<VerificationJob>, ApiClientError>
pub fn get_job_status( &self, job_id: impl Into<String> + Clone, ) -> Result<Option<VerificationJob>, ApiClientError>
§Errors
Will return Err on network error or if the verification has
failed.
Sourcepub fn get_verification_job(
&self,
job_id: &str,
) -> Result<VerificationJob, ApiClientError>
pub fn get_verification_job( &self, job_id: &str, ) -> Result<VerificationJob, ApiClientError>
§Errors
Will return Err on network error or if the verification has failed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ApiClient
impl !RefUnwindSafe for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl !UnwindSafe for ApiClient
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> 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 more