Skip to main content

ClientCore

Trait ClientCore 

Source
pub trait ClientCore {
    type Version: Version + Clone;

    // Required methods
    fn client(&self) -> Result<Client, Error>;
    fn configure(hostname: &str) -> XnatBuilder<Self::Version>;
    fn new(
        base_url: &Url,
        timeouts: &Option<Timeouts>,
        use_secure: bool,
        version: &Self::Version,
    ) -> Self;
    fn version(&self) -> &Self::Version;
}
Expand description

Core behavior for a Xnat client. Defines common use methods needed across all other client traits.

Required Associated Types§

Required Methods§

Source

fn client(&self) -> Result<Client, Error>

Constructs a REST client.

Source

fn configure(hostname: &str) -> XnatBuilder<Self::Version>

Initialize an XnatBuilder allowing configuration of an XNAT client.

use oxinat_core::*;
 
#[derive(Clone, Version, FullUri)]
#[version(root_uri = "xapi", data_uri = "data")]
struct MyVersion;
 
let builder = Xnat::configure("xnat.host.org")
    .with_version(MyVersion)
    .with_password("my-password")
    .with_username("my-username");
Source

fn new( base_url: &Url, timeouts: &Option<Timeouts>, use_secure: bool, version: &Self::Version, ) -> Self

Create a new instance of an XNAT client.

Source

fn version(&self) -> &Self::Version

Get the inner Version implementation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<V> ClientCore for Xnat<V>
where V: Version + Clone,