Struct sentry_contrib_native::RawEnvelope[][src]

pub struct RawEnvelope(_);

Wrapper for the raw envelope that we should send to Sentry.

Examples

struct CustomTransport {
    #[cfg(feature = "transport-custom")]
    dsn: Dsn,
};

impl Transport for CustomTransport {
    fn send(&self, raw_envelope: RawEnvelope) {
        // get the `Event` that is being sent
        let event: Value = raw_envelope.event();
        // serialize it, maybe move this to another thread to prevent blocking
        let envelope: Envelope = raw_envelope.serialize();
        // or convert it into a `Request` right away!
        #[cfg(feature = "transport-custom")]
        let request: Request = raw_envelope.to_request(self.dsn.clone());
    }
}

Implementations

impl RawEnvelope[src]

#[must_use = "`RawEnvelope::serialize` only converts it to an `Envelope`, this doesn't do anything until it is sent"]
pub fn serialize(&self) -> Envelope
[src]

Serialize a RawEnvelope into an Envelope.

#[must_use]
pub fn event(&self) -> Value
[src]

Yields the event that is being sent in the form of a Value.

#[must_use = "`Request` doesn't do anything until it is sent"]
pub fn to_request(&self, dsn: Dsn) -> Request
[src]

This is supported on crate feature transport-custom only.

Constructs a HTTP request for the provided RawEnvelope with a Dsn.

For more information see Envelope::into_request.

Trait Implementations

impl Debug for RawEnvelope[src]

impl Drop for RawEnvelope[src]

impl Eq for RawEnvelope[src]

impl Hash for RawEnvelope[src]

impl Ord for RawEnvelope[src]

impl PartialEq<RawEnvelope> for RawEnvelope[src]

impl PartialOrd<RawEnvelope> for RawEnvelope[src]

impl Send for RawEnvelope[src]

impl StructuralEq for RawEnvelope[src]

impl StructuralPartialEq for RawEnvelope[src]

impl Sync for RawEnvelope[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.