pub struct HttpSeedTransport { /* private fields */ }Expand description
reqwest-backed transport.
Implementations§
Source§impl HttpSeedTransport
impl HttpSeedTransport
Sourcepub fn new(base_url: &str, tls: SeedTls) -> Result<Self, RuntimeError>
pub fn new(base_url: &str, tls: SeedTls) -> Result<Self, RuntimeError>
Transport for base_url.
An https:// Seed is trusted per tls: WebPKI, or exactly the
operator-pinned certificate or key (SeedTls::PinnedSha256,
SeedTls::PinnedSpki; a Seed’s own certificate is self-signed). Certificate checking is never switched
off. A pin on an http:// base is refused (it would protect nothing
while looking as if it did).
Sourcepub fn allow_unpinned_lab_link(self) -> Self
pub fn allow_unpinned_lab_link(self) -> Self
Operator opt-in for a USB or lab link that cannot be pinned (plain http, or https verified only by WebPKI). Off by default: without it a Seed on this link cannot be bound or placed on.
Trait Implementations§
Source§impl SeedTransport for HttpSeedTransport
impl SeedTransport for HttpSeedTransport
Source§fn link_security(&self) -> LinkSecurity
fn link_security(&self) -> LinkSecurity
How this link authenticates the Seed. Fails closed.
Source§fn request<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
method: Method,
path: &'life1 str,
body: Option<&'life2 Value>,
token: &'life3 SecretString,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<(u16, Value), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn request<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
method: Method,
path: &'life1 str,
body: Option<&'life2 Value>,
token: &'life3 SecretString,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<(u16, Value), RuntimeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Send
method path with an optional JSON body; returns status and
parsed JSON (Value::Null for an empty or non-JSON body).Auto Trait Implementations§
impl !RefUnwindSafe for HttpSeedTransport
impl !UnwindSafe for HttpSeedTransport
impl Freeze for HttpSeedTransport
impl Send for HttpSeedTransport
impl Sync for HttpSeedTransport
impl Unpin for HttpSeedTransport
impl UnsafeUnpin for HttpSeedTransport
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more