pub struct CertSpotterResponseAccumulator { /* private fields */ }Expand description
Stateful, transactional parser for at most two provider response pages.
Failed page parsing does not mutate accumulated state. Transport code owns
request execution and calls Self::into_result with an external terminal
when collection ends before a parser-selected terminal.
Implementations§
Source§impl CertSpotterResponseAccumulator
impl CertSpotterResponseAccumulator
Sourcepub fn for_policy(policy: &CertSpotterPolicy) -> Self
pub fn for_policy(policy: &CertSpotterPolicy) -> Self
Creates an empty first-page accumulator from validated policy.
Sourcepub fn with_after(
policy: &CertSpotterPolicy,
after: Option<&str>,
) -> Result<Self, CertSpotterRequestError>
pub fn with_after( policy: &CertSpotterPolicy, after: Option<&str>, ) -> Result<Self, CertSpotterRequestError>
Creates an accumulator for an optional validated starting cursor.
Sourcepub fn next_after(&self) -> Option<&str>
pub fn next_after(&self) -> Option<&str>
Returns the cursor for the next request, if one exists.
Sourcepub const fn page_count(&self) -> usize
pub const fn page_count(&self) -> usize
Returns accepted provider page count.
Sourcepub const fn response_bytes(&self) -> usize
pub const fn response_bytes(&self) -> usize
Returns accepted provider bytes over all pages.
Sourcepub fn hypotheses(&self) -> &[CertSpotterNameHypothesis]
pub fn hypotheses(&self) -> &[CertSpotterNameHypothesis]
Returns unique retained hypotheses accumulated so far.
Sourcepub fn ingest_page(
&mut self,
bytes: &[u8],
) -> Result<CertSpotterPageOutcome, CertSpotterResponseError>
pub fn ingest_page( &mut self, bytes: &[u8], ) -> Result<CertSpotterPageOutcome, CertSpotterResponseError>
Parses and transactionally accepts one complete provider JSON page.
Sourcepub fn into_result(
self,
terminal: CertSpotterTerminal,
) -> Result<CertSpotterResult, CertSpotterResponseError>
pub fn into_result( self, terminal: CertSpotterTerminal, ) -> Result<CertSpotterResult, CertSpotterResponseError>
Finalizes accumulated hypotheses with one terminal transport outcome.
A parser-selected terminal must be passed back unchanged. Before such a terminal, only deadline, parent-authority, transport, or cancellation outcomes may be supplied by integration code.
Trait Implementations§
Source§impl Clone for CertSpotterResponseAccumulator
impl Clone for CertSpotterResponseAccumulator
Source§fn clone(&self) -> CertSpotterResponseAccumulator
fn clone(&self) -> CertSpotterResponseAccumulator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Eq for CertSpotterResponseAccumulator
impl StructuralPartialEq for CertSpotterResponseAccumulator
Auto Trait Implementations§
impl Freeze for CertSpotterResponseAccumulator
impl RefUnwindSafe for CertSpotterResponseAccumulator
impl Send for CertSpotterResponseAccumulator
impl Sync for CertSpotterResponseAccumulator
impl Unpin for CertSpotterResponseAccumulator
impl UnsafeUnpin for CertSpotterResponseAccumulator
impl UnwindSafe for CertSpotterResponseAccumulator
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.