Skip to main content

HttpDspClient

Struct HttpDspClient 

Source
pub struct HttpDspClient { /* private fields */ }
Expand description

Real HTTP implementation of DspClient, backed by reqwest::blocking.

Implementations§

Source§

impl HttpDspClient

Source

pub fn new() -> Result<Self, Diagnostic>

Construct a new client pair with appropriate timeouts.

  • client: 10 s connect + 30 s overall (used for all short-lived requests).
  • download_client: 30 s connect, no overall timeout (used only for streaming dump archives — they can be large).

Returns Err(Diagnostic::Internal(...)) if either reqwest client cannot be built (rare — only triggered by TLS backend misconfiguration).

Trait Implementations§

Source§

impl DspClient for HttpDspClient

Source§

fn login( &self, server: &str, user: &str, password: &str, ) -> Result<LoginResponse, Diagnostic>

Authenticate against the DSP-API at server with the given credentials. Read more
Source§

fn resolve_project( &self, server: &str, project: &str, ) -> Result<ProjectRef, Diagnostic>

Resolve a project identifier (IRI, shortcode, or shortname) on server to a ProjectRef. Read more
Source§

fn create_project_dump( &self, server: &str, project_iri: &str, skip_assets: bool, token: &str, ) -> Result<CreateDumpOutcome, Diagnostic>

Trigger a new server-side project dump on server for the project identified by project_iri. Read more
Source§

fn get_project_dump_status( &self, server: &str, project_iri: &str, dump_id: &str, token: &str, ) -> Result<DumpTask, Diagnostic>

Fetch the current status of an ongoing or completed project dump. Read more
Source§

fn download_project_dump( &self, server: &str, project_iri: &str, dump_id: &str, token: &str, dest: &mut dyn Write, ) -> Result<u64, Diagnostic>

Stream the completed dump archive into dest. Read more
Source§

fn delete_project_dump( &self, server: &str, project_iri: &str, dump_id: &str, token: &str, ) -> Result<(), Diagnostic>

Delete the server-side dump identified by dump_id. Read more
Source§

fn list_projects( &self, server: &str, token: Option<&str>, ) -> Result<Vec<Project>, Diagnostic>

List all projects on the server. Read more
Source§

fn describe_project( &self, server: &str, project: &str, token: Option<&str>, ) -> Result<ProjectDetail, Diagnostic>

Fetch the full detail of a single project (for project describe). Read more
Source§

fn describe_data_model( &self, server: &str, data_model_iri: &str, token: Option<&str>, ) -> Result<DataModelDetail, Diagnostic>

Fetch a single data-model’s full content and summarise its child resource-types, via GET /v2/ontologies/allentities/{data_model_iri}. Read more
Source§

fn data_model_structure( &self, server: &str, data_model_iri: &str, token: Option<&str>, ) -> Result<DataModelStructure, Diagnostic>

Fetch the relation graph of a single data-model, via GET /v2/ontologies/allentities/{data_model_iri}. Read more
Source§

fn list_resources( &self, server: &str, project_iri: &str, resource_type_iri: &str, order_by: Option<&str>, page: u32, token: Option<&str>, ) -> Result<ResourcePage, Diagnostic>

List resource instances of a given resource-type within a project. Read more
Source§

fn describe_resource( &self, server: &str, resource_iri: &str, token: Option<&str>, with_values: bool, ) -> Result<ResourceDetail, Diagnostic>

Fetch the full envelope metadata of a single resource by its IRI. Read more
Source§

fn verify_token(&self, server: &str, token: &str) -> Result<(), Diagnostic>

Probe server to confirm that token is currently accepted. Read more
Source§

fn list_data_models( &self, server: &str, project_iri: &str, token: Option<&str>, ) -> Result<Vec<DataModel>, Diagnostic>

List a project’s own data-models (DSP-API “ontologies”) via GET /v2/ontologies/metadata/{project_iri}. Read more
Source§

fn describe_resource_type( &self, server: &str, data_model_iri: &str, resource_type: &str, token: Option<&str>, ) -> Result<ResourceTypeDetail, Diagnostic>

Fetch the full detail of a single resource-type within a data-model, via GET /v2/ontologies/allentities/{data_model_iri}. Read more

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: Sized + 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: Sized + 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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