sync15::bso

Struct IncomingContent

source
pub struct IncomingContent<T> {
    pub envelope: IncomingEnvelope,
    pub kind: IncomingKind<T>,
}
Expand description

We also have the concept of “content”, which helps work with a T which is represented inside the payload. Real-world examples of a T include Bookmarks or Tabs. See the content module for the implementations.

So this all flows together in the following way:

  • Incoming encrypted data: EncryptedIncomingBso -> IncomingBso -> [specific engine] -> IncomingContent
  • Incoming cleartext data: IncomingBso -> IncomingContent (Note that incoming cleartext only happens for a few collections managed by the sync client and never by specific engines - engine BSOs are always encryted)
  • Outgoing encrypted data: OutgoingBso (created in the engine) -> [this crate] -> EncryptedOutgoingBso
  • Outgoing cleartext data: just an OutgoingBso with no conversions needed. IncomingContent is the result of converting an IncomingBso into some - it consumes the Bso, so you get the envelope, and the IncomingKind which reflects the state of parsing the json.

Fields§

§envelope: IncomingEnvelope§kind: IncomingKind<T>

Implementations§

source§

impl<T> IncomingContent<T>

source

pub fn content(self) -> Option<T>

Returns Some(content) if [self.kind] is IncomingKind::Content, None otherwise.

Trait Implementations§

source§

impl<T: Debug> Debug for IncomingContent<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for IncomingContent<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for IncomingContent<T>
where T: RefUnwindSafe,

§

impl<T> Send for IncomingContent<T>
where T: Send,

§

impl<T> Sync for IncomingContent<T>
where T: Sync,

§

impl<T> Unpin for IncomingContent<T>
where T: Unpin,

§

impl<T> UnwindSafe for IncomingContent<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T