pub struct PhotonBuilder { /* private fields */ }Expand description
Implementations§
Source§impl PhotonBuilder
impl PhotonBuilder
Sourcepub fn storage_port(self, port: Arc<dyn StoragePort>) -> Self
pub fn storage_port(self, port: Arc<dyn StoragePort>) -> Self
Explicit storage port (defaults to in-process mem tier).
§Example
use std::sync::Arc;
use photon_backend::{InProcStoragePort, StoragePort, TransportCrypto};
use photon_runtime::Photon;
let port: Arc<dyn StoragePort> = Arc::new(InProcStoragePort::new(
TransportCrypto::from_env()?,
));
let _photon = Photon::builder().storage_port(port).auto_registry().build()?;Sourcepub fn backend(self, backend: Arc<dyn PhotonBackend>) -> Self
pub fn backend(self, backend: Arc<dyn PhotonBackend>) -> Self
Pre-built backend instance.
Sourcepub fn backend_with_context<F>(self, install: F) -> Self
pub fn backend_with_context<F>(self, install: F) -> Self
Build backend from shared BackendContext (typical for custom install fns).
Sourcepub fn mem_backend(self) -> Self
pub fn mem_backend(self) -> Self
Shorthand for Self::backend_with_context.
Sourcepub fn ops_log(self, log: impl OpsLog + 'static) -> Self
pub fn ops_log(self, log: impl OpsLog + 'static) -> Self
Install a concrete OpsLog adapter before build.
Sourcepub fn ops_log_arc(self, log: Arc<dyn OpsLog>) -> Self
pub fn ops_log_arc(self, log: Arc<dyn OpsLog>) -> Self
Install a shared OpsLog trait object before build.
Sourcepub const fn auto_registry(self) -> Self
pub const fn auto_registry(self) -> Self
Discover #[photon::topic] descriptors via Quark inventory instead of an empty registry.
Required when using #[topic] / #[subscribe] in the same crate graph as the host.
Runnable: cargo run -p uf-photon --example embedded_mem --features runtime,mem.
Sourcepub fn retention_policy(self, policy: RetentionPolicy) -> Self
pub fn retention_policy(self, policy: RetentionPolicy) -> Self
Override default retention policy (env fallbacks apply for unset fields).
Sourcepub fn retention_hook(self, hook: Arc<dyn RetentionHook>) -> Self
pub fn retention_hook(self, hook: Arc<dyn RetentionHook>) -> Self
Host hook for extra subscriptions and legal-hold floors.
Trait Implementations§
Source§impl Default for PhotonBuilder
impl Default for PhotonBuilder
Source§fn default() -> PhotonBuilder
fn default() -> PhotonBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for PhotonBuilder
impl !Sync for PhotonBuilder
impl !UnwindSafe for PhotonBuilder
impl Freeze for PhotonBuilder
impl Send for PhotonBuilder
impl Unpin for PhotonBuilder
impl UnsafeUnpin for PhotonBuilder
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