pub struct Global {
    pub sync_group: u32,
    pub routing_hint: u32,
}
Expand description

Settings not associated with any specific type of transport.

Fields

sync_group: u32

The sync group for this device.

When peer-to-peer transports are enabled, all devices with the same App ID will normally form an interconnected mesh network. In some situations it may be desirable to have distinct groups of devices within the same app, so that connections will only be formed within each group. The sync_group parameter changes that group membership. A device can only ever be in one sync group, which by default is group 0. Up to 2^32 distinct group numbers can be used in an app.

This is an optimization, not a security control. If a connection is created manually, such as by specifying a connect transport, then devices from different sync groups will still sync as normal. If two groups of devices are intended to have access to different data sets, this must be enforced using Ditto’s permissions system.

routing_hint: u32

The routing hint for this device.

A routing hint is a performance tuning option which can improve the performance of applications that use large collections. Ditto will make a best effort to co-locate data for the same routing key. In most circumstances, this should substantially improve responsiveness of the Ditto Cloud.

The value of the routing hint is application specific - you are free to chose any value. Devices which you expect to operate on much the same data should be configured to use the same value.

A routing hint does not partition data. The value of the routing hint will not affect the data returned for a query. The routing hint only improves the efficiency of the Cloud’s ability to satisfy the query.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Applies the [Compat] adapter by value. Read more
Applies the [Compat] adapter by shared reference. Read more
Applies the [Compat] adapter by mutable reference. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Converts to T by calling Into<T>::into.
Tries to convert to T by calling TryInto<T>::try_into.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.