pub struct RefgetClient { /* private fields */ }Expand description
Async HTTP client for a refget server.
Supports the GA4GH refget Sequences v2.0.0 and Sequence Collections v1.0.0 APIs.
Implementations§
Source§impl RefgetClient
impl RefgetClient
Sourcepub fn new(base_url: &str) -> ClientResult<Self>
pub fn new(base_url: &str) -> ClientResult<Self>
Create a new client with a default reqwest::Client.
Sourcepub fn with_client(client: Client, base_url: &str) -> ClientResult<Self>
pub fn with_client(client: Client, base_url: &str) -> ClientResult<Self>
Create a new client with a pre-configured reqwest::Client.
Sourcepub async fn get_sequence(
&self,
digest: &str,
start: Option<u64>,
end: Option<u64>,
) -> ClientResult<Option<Vec<u8>>>
pub async fn get_sequence( &self, digest: &str, start: Option<u64>, end: Option<u64>, ) -> ClientResult<Option<Vec<u8>>>
Retrieve a sequence (or subsequence) by digest.
With start and/or end set, retrieves a subsequence (0-based, half-open).
The server handles defaulting omitted bounds.
Sourcepub async fn get_metadata(
&self,
digest: &str,
) -> ClientResult<Option<SequenceMetadata>>
pub async fn get_metadata( &self, digest: &str, ) -> ClientResult<Option<SequenceMetadata>>
Retrieve metadata for a sequence by digest.
Sourcepub async fn get_sequence_service_info(
&self,
) -> ClientResult<SequenceServiceInfo>
pub async fn get_sequence_service_info( &self, ) -> ClientResult<SequenceServiceInfo>
Retrieve the sequence service-info.
Sourcepub async fn get_collection_level0(
&self,
digest: &str,
) -> ClientResult<Option<String>>
pub async fn get_collection_level0( &self, digest: &str, ) -> ClientResult<Option<String>>
Retrieve a collection at Level 0 (single digest string).
Sourcepub async fn get_collection_level1(
&self,
digest: &str,
) -> ClientResult<Option<SeqColLevel1>>
pub async fn get_collection_level1( &self, digest: &str, ) -> ClientResult<Option<SeqColLevel1>>
Retrieve a collection at Level 1 (per-attribute digests).
Sourcepub async fn get_collection_level2(
&self,
digest: &str,
) -> ClientResult<Option<SeqCol>>
pub async fn get_collection_level2( &self, digest: &str, ) -> ClientResult<Option<SeqCol>>
Retrieve a collection at Level 2 (full arrays).
Sourcepub async fn get_collection_raw(
&self,
digest: &str,
level: u8,
) -> ClientResult<Option<Value>>
pub async fn get_collection_raw( &self, digest: &str, level: u8, ) -> ClientResult<Option<Value>>
Retrieve a collection at an arbitrary level as raw JSON.
Sourcepub async fn compare_collections(
&self,
digest_a: &str,
digest_b: &str,
) -> ClientResult<ComparisonResult>
pub async fn compare_collections( &self, digest_a: &str, digest_b: &str, ) -> ClientResult<ComparisonResult>
Compare two collections by their digests.
Sourcepub async fn compare_collection_with(
&self,
digest: &str,
collection: &SeqCol,
) -> ClientResult<ComparisonResult>
pub async fn compare_collection_with( &self, digest: &str, collection: &SeqCol, ) -> ClientResult<ComparisonResult>
Compare a stored collection (by digest) with a provided collection via POST.
Sourcepub async fn list_collections(
&self,
filters: &[(&str, &str)],
page: usize,
page_size: usize,
) -> ClientResult<Value>
pub async fn list_collections( &self, filters: &[(&str, &str)], page: usize, page_size: usize, ) -> ClientResult<Value>
List collections with optional filters and pagination.
Returns the raw JSON response which includes items, total, page, and page_size.
Sourcepub async fn get_attribute(
&self,
attr: &str,
digest: &str,
) -> ClientResult<Option<Value>>
pub async fn get_attribute( &self, attr: &str, digest: &str, ) -> ClientResult<Option<Value>>
Get a single attribute array by attribute name and its digest.
Sourcepub async fn get_seqcol_service_info(&self) -> ClientResult<Value>
pub async fn get_seqcol_service_info(&self) -> ClientResult<Value>
Get the sequence collections service-info as raw JSON.