pub struct JsonIdentityFactory;Expand description
Re-export identity port traits and JSON stubs from photon_core.
Reconstructs JsonActor from JSON captured at publish time.
Sufficient for README examples, integration tests, and local Getting started walkthroughs that
only need a debug label at the handler boundary. Production hosts usually wire a custom
IdentityFactory that maps to real principal types.
§Example
ⓘ
use std::sync::Arc;
use photon_core::JsonIdentityFactory;
use photon_runtime::Photon;
let photon = Photon::builder().auto_registry().build()?;
photon.start_executor(Arc::new(JsonIdentityFactory))?;Trait Implementations§
Source§impl Clone for JsonIdentityFactory
impl Clone for JsonIdentityFactory
Source§fn clone(&self) -> JsonIdentityFactory
fn clone(&self) -> JsonIdentityFactory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for JsonIdentityFactory
Source§impl Debug for JsonIdentityFactory
impl Debug for JsonIdentityFactory
Source§impl Default for JsonIdentityFactory
impl Default for JsonIdentityFactory
Source§fn default() -> JsonIdentityFactory
fn default() -> JsonIdentityFactory
Returns the “default value” for a type. Read more
Source§impl IdentityFactory for JsonIdentityFactory
impl IdentityFactory for JsonIdentityFactory
Source§fn reconstruct(&self, actor_json: &str) -> Result<Box<dyn Actor>, IdentityError>
fn reconstruct(&self, actor_json: &str) -> Result<Box<dyn Actor>, IdentityError>
Build an actor for
#[photon::subscribe] dispatch. Read moreAuto Trait Implementations§
impl Freeze for JsonIdentityFactory
impl RefUnwindSafe for JsonIdentityFactory
impl Send for JsonIdentityFactory
impl Sync for JsonIdentityFactory
impl Unpin for JsonIdentityFactory
impl UnsafeUnpin for JsonIdentityFactory
impl UnwindSafe for JsonIdentityFactory
Blanket Implementations§
impl<T> AsyncConnector for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more