pub struct HttpWitness { /* private fields */ }Expand description
A remote witness reached over tlog-witness.
Implementations§
Source§impl HttpWitness
impl HttpWitness
Sourcepub fn new(
prefix: impl Into<String>,
log: LogKey,
trusted: Vec<TrustedWitness>,
) -> Result<Self, WitnessError>
pub fn new( prefix: impl Into<String>, log: LogKey, trusted: Vec<TrustedWitness>, ) -> Result<Self, WitnessError>
Point at a witness.
prefix is the submission prefix, without /add-checkpoint.
§Errors
If an HTTP client cannot be built, or if trusted is empty — a witness
whose cosignature nothing can check is not a witness, and accepting one
would make every quorum below it a count of HTTP status codes.
Sourcepub fn reader(&self) -> Result<WitnessReader, WitnessError>
pub fn reader(&self) -> Result<WitnessReader, WitnessError>
A reader for what this witness holds, at its monitoring prefix.
The same trusted keys, so a deployment that submits and then reads back cannot end up holding one set of keys for the round trip and another for the check.
§Errors
If an HTTP client cannot be built.
Sourcepub fn monitoring_at(self, prefix: impl Into<String>) -> Self
pub fn monitoring_at(self, prefix: impl Into<String>) -> Self
Read this witness at a different prefix from the one submissions go to.
Only needed where the deployment splits them — a monitoring prefix delegated to a CDN, which the specification explicitly allows for.
Trait Implementations§
Source§impl Clone for HttpWitness
impl Clone for HttpWitness
Source§impl Debug for HttpWitness
impl Debug for HttpWitness
Source§impl Witness for HttpWitness
impl Witness for HttpWitness
Source§fn cosign<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
checkpoint: &'life1 Checkpoint,
old_size: u64,
proof: &'life2 [Digest],
) -> Pin<Box<dyn Future<Output = Result<Cosignature, WitnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn cosign<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
checkpoint: &'life1 Checkpoint,
old_size: u64,
proof: &'life2 [Digest],
) -> Pin<Box<dyn Future<Output = Result<Cosignature, WitnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for HttpWitness
impl !UnwindSafe for HttpWitness
impl Freeze for HttpWitness
impl Send for HttpWitness
impl Sync for HttpWitness
impl Unpin for HttpWitness
impl UnsafeUnpin for HttpWitness
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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