pub struct HttpDspClient { /* private fields */ }Expand description
Real HTTP implementation of DspClient, backed by reqwest::blocking.
Implementations§
Source§impl HttpDspClient
impl HttpDspClient
Sourcepub fn new() -> Result<Self, Diagnostic>
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
impl DspClient for HttpDspClient
Source§fn login(
&self,
server: &str,
user: &str,
password: &str,
) -> Result<LoginResponse, Diagnostic>
fn login( &self, server: &str, user: &str, password: &str, ) -> Result<LoginResponse, Diagnostic>
Authenticate against the DSP-API at
server with the given credentials. Read moreSource§fn resolve_project(
&self,
server: &str,
project: &str,
) -> Result<ProjectRef, Diagnostic>
fn resolve_project( &self, server: &str, project: &str, ) -> Result<ProjectRef, Diagnostic>
Source§fn create_project_dump(
&self,
server: &str,
project_iri: &str,
skip_assets: bool,
token: &str,
) -> Result<CreateDumpOutcome, Diagnostic>
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 moreSource§fn get_project_dump_status(
&self,
server: &str,
project_iri: &str,
dump_id: &str,
token: &str,
) -> Result<DumpTask, Diagnostic>
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>
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 moreSource§fn delete_project_dump(
&self,
server: &str,
project_iri: &str,
dump_id: &str,
token: &str,
) -> Result<(), Diagnostic>
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 moreSource§fn list_projects(
&self,
server: &str,
token: Option<&str>,
) -> Result<Vec<Project>, Diagnostic>
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>
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 moreSource§fn describe_data_model(
&self,
server: &str,
data_model_iri: &str,
token: Option<&str>,
) -> Result<DataModelDetail, Diagnostic>
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 moreSource§fn data_model_structure(
&self,
server: &str,
data_model_iri: &str,
token: Option<&str>,
) -> Result<DataModelStructure, Diagnostic>
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 moreSource§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>
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>
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>
fn verify_token(&self, server: &str, token: &str) -> Result<(), Diagnostic>
Source§fn list_data_models(
&self,
server: &str,
project_iri: &str,
token: Option<&str>,
) -> Result<Vec<DataModel>, Diagnostic>
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 moreSource§fn describe_resource_type(
&self,
server: &str,
data_model_iri: &str,
resource_type: &str,
token: Option<&str>,
) -> Result<ResourceTypeDetail, Diagnostic>
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for HttpDspClient
impl !UnwindSafe for HttpDspClient
impl Freeze for HttpDspClient
impl Send for HttpDspClient
impl Sync for HttpDspClient
impl Unpin for HttpDspClient
impl UnsafeUnpin for HttpDspClient
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