Struct Envelope
pub struct Envelope { /* private fields */ }
Expand description
A Sentry Envelope.
An Envelope is the data format that Sentry uses for Ingestion. It can contain multiple Items, some of which are related, such as Events, and Event Attachments. Other Items, such as Sessions are independent.
See the documentation on Envelopes for more details.
Implementations§
§impl Envelope
impl Envelope
pub fn add_item<I>(&mut self, item: I)where
I: Into<EnvelopeItem>,
pub fn add_item<I>(&mut self, item: I)where
I: Into<EnvelopeItem>,
Add a new Envelope Item.
pub fn items(&self) -> EnvelopeItemIter<'_> ⓘ
pub fn items(&self) -> EnvelopeItemIter<'_> ⓘ
Create an Iterator
over all the EnvelopeItem
s.
pub fn filter<P>(self, predicate: P) -> Option<Envelope>
pub fn filter<P>(self, predicate: P) -> Option<Envelope>
Filters the Envelope’s EnvelopeItem
s based on a predicate,
and returns a new Envelope containing only the filtered items.
Retains the EnvelopeItem
s for which the predicate returns true
.
Additionally, EnvelopeItem::Attachment
s are only kept if the Envelope
contains an EnvelopeItem::Event
or EnvelopeItem::Transaction
.
None
is returned if no items remain in the Envelope after filtering.
pub fn to_writer<W>(&self, writer: W) -> Result<(), Error>where
W: Write,
pub fn to_writer<W>(&self, writer: W) -> Result<(), Error>where
W: Write,
Serialize the Envelope into the given Write
.
pub fn from_slice(slice: &[u8]) -> Result<Envelope, EnvelopeError>
pub fn from_slice(slice: &[u8]) -> Result<Envelope, EnvelopeError>
Creates a new Envelope from slice.
pub fn from_bytes_raw(bytes: Vec<u8>) -> Result<Envelope, EnvelopeError>
pub fn from_bytes_raw(bytes: Vec<u8>) -> Result<Envelope, EnvelopeError>
Creates a new raw Envelope from the given buffer.
pub fn from_path<P>(path: P) -> Result<Envelope, EnvelopeError>
pub fn from_path<P>(path: P) -> Result<Envelope, EnvelopeError>
Creates a new Envelope from path.
pub fn from_path_raw<P>(path: P) -> Result<Envelope, EnvelopeError>
pub fn from_path_raw<P>(path: P) -> Result<Envelope, EnvelopeError>
Creates a new Envelope from path without attempting to parse anything.
The resulting Envelope will have no event_id
and the file contents will
be contained verbatim in the items
field.
Trait Implementations§
§impl<T> From<T> for Envelopewhere
T: Into<EnvelopeItem>,
impl<T> From<T> for Envelopewhere
T: Into<EnvelopeItem>,
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnwindSafe for Envelope
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)