pub struct SmallPeerInfo { /* private fields */ }
Expand description

The entrypoint for small peer user info collection. Small peer info consists of information gathered into a system collection on a regular interval and optionally synced to the Big Peer for device dashboard and debugging purposes.

You don’t create this class directly, but can access it from a particular Ditto instance via its Ditto::small_peer_info method.

Implementations§

source§

impl SmallPeerInfo

source

pub fn is_enabled(&self) -> bool

Indicates whether small peer info collection is currently enabled, defaults to false.

Small peer info consists of information scraped into a system collection at repeated intervals and synced to the Big Peer for device dashboard and debugging purposes.

Note: whether the background ingestion process is enabled or not is a separate decision to whether this information is allowed to sync to other peers (including the big peer). This is controlled by DittoSmallPeerInfoSyncScope.

source

pub fn set_enabled(&self, enabled: bool)

Sets whether small peer info collection is currently enabled.

source

pub fn sync_scope(&self) -> DittoSmallPeerInfoSyncScope

Determines which “kind” of peers the small peer info will be replicate to, defaults to DittoSmallPeerInfoSyncScope::LocalPeerOnly.

source

pub fn set_sync_scope(&self, sync_scope: DittoSmallPeerInfoSyncScope)

Sets which “kind” of peers the small peer info will be replicated to.

source

pub fn metadata<T: DeserializeOwned>(&self) -> Result<T, DittoError>

Returns the JSON metadata being associated with the small peer info.

source

pub fn set_metadata<T: Serialize>(&self, metadata: &T) -> Result<(), DittoError>

Sets the JSON metadata to be associated with the small peer info.

The metadata is a free-form, user-provided dictionary that is serialized into JSON and is inserted into the small peer info system doc at each collection interval. The dictionary has no schema except for the following constraints:

  1. All contained values must be JSON serializable.
  2. The size of the dictionary serialized as JSON may not exceed 128 KB.
  3. The dictionary may only be nested up to 64 levels deep.
source

pub fn metadata_json_string(&self) -> Result<String, DittoError>

Returns the JSON string of the metadata being associated with the small peer info.

source

pub fn set_metadata_json_string(&self, metadata: &str) -> Result<(), DittoError>

Sets the JSON metadata to be associated with the small peer info.

The metadata is free-form, user-provided string is serialized into JSON and is inserted into the small peer info system doc at each collection interval. The dictionary has no schema except for the following constraints:

  1. All contained values must be JSON serializable.
  2. The size of the dictionary serialized as JSON may not exceed 128 KB.
  3. The dictionary may only be nested up to 64 levels deep.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
§

impl<T> FitForCBox for T

§

type CBoxWrapped = Box_<T>

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> ManuallyDropMut for T

§

type Ret = ManuallyDrop<T>

§

fn manually_drop_mut<'__>(&'__ mut self) -> &'__ mut ManuallyDrop<T>

§

impl<T> To for Twhere T: ?Sized,

§

fn to<T>(self) -> Twhere Self: Into<T>,

Converts to T by calling Into<T>::into.
§

fn try_to<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
source§

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

§

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 Twhere U: TryFrom<T>,

§

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 Twhere V: MultiLane<T>,

§

fn vzip(self) -> V