pub struct GenServerSpec {
pub module_name: String,
pub state_doc: String,
pub handle_calls: Vec<(BeamPattern, BeamExpr)>,
pub handle_casts: Vec<(BeamPattern, BeamExpr)>,
pub handle_infos: Vec<(BeamPattern, BeamExpr)>,
pub init_state: BeamExpr,
pub terminate_body: Option<BeamExpr>,
}Expand description
A gen_server behaviour specification.
gen_server is the OTP generic server process behaviour.
Fields§
§module_name: StringModule name
state_doc: StringInitial state type (as a comment / documentation)
handle_calls: Vec<(BeamPattern, BeamExpr)>Synchronous call handlers: (request_pattern, reply_expr)
handle_casts: Vec<(BeamPattern, BeamExpr)>Asynchronous cast handlers: (message_pattern, new_state_expr)
handle_infos: Vec<(BeamPattern, BeamExpr)>Info message handlers: (message_pattern, new_state_expr)
init_state: BeamExprInitial state expression
terminate_body: Option<BeamExpr>Termination callback body
Implementations§
Source§impl GenServerSpec
impl GenServerSpec
Trait Implementations§
Source§impl Clone for GenServerSpec
impl Clone for GenServerSpec
Source§fn clone(&self) -> GenServerSpec
fn clone(&self) -> GenServerSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GenServerSpec
impl RefUnwindSafe for GenServerSpec
impl Send for GenServerSpec
impl Sync for GenServerSpec
impl Unpin for GenServerSpec
impl UnsafeUnpin for GenServerSpec
impl UnwindSafe for GenServerSpec
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