pub struct Platform {Show 13 fields
pub clock: Arc<dyn Clock>,
pub events: EventBus,
pub storage: Arc<dyn Storage>,
pub cache: Cache,
pub secrets: Arc<dyn SecretStore>,
pub settings: Settings,
pub notifications: Arc<dyn NotificationService>,
pub jobs: Jobs,
pub sync: SyncEngine,
pub accounts: AccountService,
pub connectors: ConnectorRegistry,
pub opener: Option<Arc<dyn Opener>>,
pub http: Option<Arc<dyn HttpClient>>,
}Expand description
The platform services every module may rely on.
Cloning is cheap and shares the same instances.
Optional fields are capabilities the product did not grant. They are None because
the composition root left them out, not because they are switched off at runtime —
a build that cannot reach the network is a build that cannot reach the network.
Fields§
§clock: Arc<dyn Clock>§events: EventBus§storage: Arc<dyn Storage>§cache: Cache§secrets: Arc<dyn SecretStore>§settings: Settings§notifications: Arc<dyn NotificationService>§jobs: JobsBackground jobs: progress, cancellation, uniform lifecycle.
sync: SyncEngineDecides when registered sync targets run.
accounts: AccountServiceConnected accounts across all connectors.
connectors: ConnectorRegistryThe connectors this build was compiled with.
opener: Option<Arc<dyn Opener>>Present only when the product declared the capability to open external URLs.
http: Option<Arc<dyn HttpClient>>Present only when the product talks to external services.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Platform
impl !UnwindSafe for Platform
impl Freeze for Platform
impl Send for Platform
impl Sync for Platform
impl Unpin for Platform
impl UnsafeUnpin for Platform
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