[][src]Struct sync15_traits::bridged_engine::IncomingEnvelope

pub struct IncomingEnvelope {
    pub id: Guid,
    pub modified: ServerTimestamp,
    pub sortindex: Option<i32>,
    pub ttl: Option<u32>,
    cleartext: String,
}

An envelope for an incoming item, passed to BridgedEngine::store_incoming. Envelopes are a halfway point between BSOs, the format used for all items on the Sync server, and records, which are specific to each engine.

A BSO is a JSON object with metadata fields (id, modifed, sortindex), and a BSO payload that is itself a JSON string. For encrypted records, the BSO payload has a ciphertext, which must be decrypted to yield a cleartext. The cleartext is a JSON string (that's three levels of JSON wrapping, if you're keeping score: the BSO itself, BSO payload, and cleartext) with the actual record payload.

An envelope combines the metadata fields from the BSO, and the cleartext from the encrypted BSO payload.

Fields

id: Guidmodified: ServerTimestampsortindex: Option<i32>ttl: Option<u32>cleartext: String

Implementations

impl IncomingEnvelope[src]

pub fn payload(&self) -> Result<Payload, PayloadError>[src]

Parses and returns the record payload from this envelope. Returns an error if the envelope's cleartext isn't valid JSON, or the payload is invalid.

Trait Implementations

impl Clone for IncomingEnvelope[src]

impl Debug for IncomingEnvelope[src]

impl<'de> Deserialize<'de> for IncomingEnvelope[src]

Auto Trait Implementations

impl RefUnwindSafe for IncomingEnvelope

impl Send for IncomingEnvelope

impl Sync for IncomingEnvelope

impl Unpin for IncomingEnvelope

impl UnwindSafe for IncomingEnvelope

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,