pub trait EnvelopeCollection<'env>: MaybeSend + MaybeSync {
// Required methods
fn topics(&self) -> Result<Vec<Topic>, EnvelopeError>;
fn cursors(&self) -> Result<Vec<Cursor>, EnvelopeError>;
fn payloads(&self) -> Result<Vec<Payload>, EnvelopeError>;
fn orphans(&self) -> Result<Vec<OrphanedEnvelope>, EnvelopeError>;
fn sha256_hashes(&self) -> Result<Vec<Vec<u8>>, EnvelopeError>;
fn client_envelopes(&self) -> Result<Vec<ClientEnvelope>, EnvelopeError>;
fn group_messages(&self) -> Result<Vec<Option<GroupMessage>>, EnvelopeError>;
fn welcome_messages(
&self,
) -> Result<Vec<Option<WelcomeMessage>>, EnvelopeError>;
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn consume<E>(self) -> Result<Vec<<E as Extractor>::Output>, EnvelopeError>
where for<'a> E: Default + Extractor + EnvelopeVisitor<'a>,
for<'a> EnvelopeError: From<<E as EnvelopeVisitor<'a>>::Error>,
Self: Sized;
}Expand description
A Generic Higher-Level Collection of Envelopes
Required Methods§
Sourcefn orphans(&self) -> Result<Vec<OrphanedEnvelope>, EnvelopeError>
fn orphans(&self) -> Result<Vec<OrphanedEnvelope>, EnvelopeError>
get orphans for these envelopes
Sourcefn sha256_hashes(&self) -> Result<Vec<Vec<u8>>, EnvelopeError>
fn sha256_hashes(&self) -> Result<Vec<Vec<u8>>, EnvelopeError>
get the data field for each envelope as a sha256 hash
Sourcefn client_envelopes(&self) -> Result<Vec<ClientEnvelope>, EnvelopeError>
fn client_envelopes(&self) -> Result<Vec<ClientEnvelope>, EnvelopeError>
Build the ClientEnvelope
Sourcefn group_messages(&self) -> Result<Vec<Option<GroupMessage>>, EnvelopeError>
fn group_messages(&self) -> Result<Vec<Option<GroupMessage>>, EnvelopeError>
Try to get a group message from this Envelope
Sourcefn welcome_messages(&self) -> Result<Vec<Option<WelcomeMessage>>, EnvelopeError>
fn welcome_messages(&self) -> Result<Vec<Option<WelcomeMessage>>, EnvelopeError>
Try to get a welcome message
Sourcefn consume<E>(self) -> Result<Vec<<E as Extractor>::Output>, EnvelopeError>where
for<'a> E: Default + Extractor + EnvelopeVisitor<'a>,
for<'a> EnvelopeError: From<<E as EnvelopeVisitor<'a>>::Error>,
Self: Sized,
fn consume<E>(self) -> Result<Vec<<E as Extractor>::Output>, EnvelopeError>where
for<'a> E: Default + Extractor + EnvelopeVisitor<'a>,
for<'a> EnvelopeError: From<<E as EnvelopeVisitor<'a>>::Error>,
Self: Sized,
run a sequenced extraction on the envelopes in this collection