Struct dittolive_ditto::ditto::Ditto[][src]

pub struct Ditto { /* fields omitted */ }
Expand description

The entry point for accessing Ditto-related functionality This struct is generally a handle and interface to ditto-functionality which operates in background threads.

Implementations

Start syncing on all configured transports May panic if misconfigured or license is not yet validated

Start syncing on all configured transports

Stop syncing on all transports

Set a new TransportConfig and being syncing over these transports Any change to start or stop a specific transport should proceed via providing a modified configuration to this method

Returns a snapshot of the currently configured transports

👎 Deprecated since 1.2.0:

please use set_offline_only_license_token instead

Activate an offline Ditto instance by setting a license token. You cannot initiate sync on an offline (Development, OfflinePlayground, Manual or SharedKey) Ditto instance before you have activated it.

Activate an offline Ditto instance by setting a license token. You cannot initiate sync on an offline (Development, OfflinePlayground, Manual or SharedKey) Ditto instance before you have activated it.

👎 Deprecated since 1.0.5:

please use set_offline_only_license_token instead

Activate an offline Ditto instance by setting a license token. You cannot initiate sync on an offline (Development, OfflinePlayground, Manual or SharedKey) Ditto instance before you have activated it.

Look for a license token from a given environment variable

Returns a reference to the underlying local data store

Returns the site ID that the instance of Ditto is using as part of its identity.

Set a custom identifier for the current device

When using observePeers(), each remote peer is represented by a short UTF-8 “device name”. By default this will be a truncated version of the device’s hostname. It does not need to be unique among peers. Configure the device name before calling start(). If it is too long it will be truncated.

Request bulk status information about the transports. This is mostly intended for statistical or debugging purposes.

Request information about Ditto peers in range of this device.

This method returns an observer which should be held as long as updates are required. A newly registered observer will have a peers update delivered to it immediately. Then it will be invoked repeatedly when Ditto devices come and go, or the active connections to them change.

Has this Ditto instance been activated yet with a valid license token

Returns a builder for Ditto following the builder pattern Start constructing a new Ditto instance

Construct a Ditto instance with sensible defaults This instance will still need to have a license set and sync functionality manually started

Removes all sync metadata for any remote peers which aren’t currently connected. This method shouldn’t usually be called. Manually running garbage collection often will result in slower sync times. Ditto automatically runs a garbage a collection process in the background at optimal times.

Manually running garbage collection is typically only useful during testing if large amounts of data are being generated. Alternatively, if an entire data set is to be evicted and it’s clear that maintaining this metadata isn’t necessary, then garbage collection could be run after evicting the old data.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Executes the destructor for this type. 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

Performs the conversion.

Performs the conversion.

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

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

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.