pub struct User {
pub id: UserId,
pub name: String,
pub email: String,
}Fields§
§id: UserId§name: String§email: StringImplementations§
Trait Implementations§
Source§impl ActorClient<User> for UserClient
impl ActorClient<User> for UserClient
Source§fn map_error(e: FrameworkError) -> Self::Error
fn map_error(e: FrameworkError) -> Self::Error
Map framework errors to the specific resource error type.
Source§impl ActorEntity for User
impl ActorEntity for User
Source§fn from_create_params(
id: UserId,
params: UserCreate,
) -> Result<Self, Self::Error>
fn from_create_params( id: UserId, params: UserCreate, ) -> Result<Self, Self::Error>
Creates a new User from creation parameters.
Source§fn on_update<'life0, 'life1, 'async_trait>(
&'life0 mut self,
update: UserUpdate,
_ctx: &'life1 Self::Context,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_update<'life0, 'life1, 'async_trait>(
&'life0 mut self,
update: UserUpdate,
_ctx: &'life1 Self::Context,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handles updates to the User entity.
§Fields Updated
name: User’s display nameemail: User’s email address
Source§type Id = UserId
type Id = UserId
The unique identifier for this entity (e.g., String, Uuid, u64).
Must be convertible from u32 for automatic ID generation.
Source§type Create = UserCreate
type Create = UserCreate
The data required to create a new instance (DTO - Data Transfer Object).
Source§type Update = UserUpdate
type Update = UserUpdate
The data required to update an existing instance.
Source§type Action = UserAction
type Action = UserAction
Enum representing resource-specific operations (e.g.,
ReserveStock).Source§type ActionResult = ()
type ActionResult = ()
The result type returned by custom actions.
Source§type Context = ()
type Context = ()
The runtime context (dependencies) injected into the actor.
Use
() if no dependencies are needed.Source§type Error = UserError
type Error = UserError
The error type for this entity.
Must implement std::error::Error for proper error propagation. Read more
Source§fn handle_action<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_action: UserAction,
_ctx: &'life1 Self::Context,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_action<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_action: UserAction,
_ctx: &'life1 Self::Context,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle a custom resource-specific action.
§fn on_create<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 Self::Context,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_create<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_ctx: &'life1 Self::Context,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Called immediately after the entity is created and initialized.
Use this hook to perform validation or side effects (e.g., checking other actors).
§fn on_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 Self::Context,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn on_delete<'life0, 'life1, 'async_trait>(
&'life0 self,
_ctx: &'life1 Self::Context,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Called immediately before the entity is removed from the system.
impl StructuralPartialEq for User
Auto Trait Implementations§
impl Freeze for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnwindSafe for User
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