Skip to main content

RefgetClient

Struct RefgetClient 

Source
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

Source

pub fn new(base_url: &str) -> ClientResult<Self>

Create a new client with a default reqwest::Client.

Source

pub fn with_client(client: Client, base_url: &str) -> ClientResult<Self>

Create a new client with a pre-configured reqwest::Client.

Source

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.

Source

pub async fn get_metadata( &self, digest: &str, ) -> ClientResult<Option<SequenceMetadata>>

Retrieve metadata for a sequence by digest.

Source

pub async fn get_sequence_service_info( &self, ) -> ClientResult<SequenceServiceInfo>

Retrieve the sequence service-info.

Source

pub async fn get_collection_level0( &self, digest: &str, ) -> ClientResult<Option<String>>

Retrieve a collection at Level 0 (single digest string).

Source

pub async fn get_collection_level1( &self, digest: &str, ) -> ClientResult<Option<SeqColLevel1>>

Retrieve a collection at Level 1 (per-attribute digests).

Source

pub async fn get_collection_level2( &self, digest: &str, ) -> ClientResult<Option<SeqCol>>

Retrieve a collection at Level 2 (full arrays).

Source

pub async fn get_collection_raw( &self, digest: &str, level: u8, ) -> ClientResult<Option<Value>>

Retrieve a collection at an arbitrary level as raw JSON.

Source

pub async fn compare_collections( &self, digest_a: &str, digest_b: &str, ) -> ClientResult<ComparisonResult>

Compare two collections by their digests.

Source

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.

Source

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.

Source

pub async fn get_attribute( &self, attr: &str, digest: &str, ) -> ClientResult<Option<Value>>

Get a single attribute array by attribute name and its digest.

Source

pub async fn get_seqcol_service_info(&self) -> ClientResult<Value>

Get the sequence collections service-info as raw JSON.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more