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>
impl<T> IncomingContent<T>
sourcepub fn content(self) -> Option<T>
pub fn content(self) -> Option<T>
Returns Some(content) if [self.kind] is IncomingKind::Content, None otherwise.
Trait Implementations§
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> 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
Mutably borrows from an owned value. Read more
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read more