pub trait GenServer: Send + 'static {
// Required methods
fn init(
&mut self,
args: Vec<OwnedTerm>,
) -> impl Future<Output = Result<()>> + Send + '_;
fn handle_call(
&mut self,
msg: OwnedTerm,
from: ExternalPid,
) -> impl Future<Output = Result<CallResult>> + Send + '_;
fn handle_cast(
&mut self,
msg: OwnedTerm,
) -> impl Future<Output = Result<()>> + Send + '_;
fn handle_info(
&mut self,
msg: OwnedTerm,
) -> impl Future<Output = Result<()>> + Send + '_;
// Provided method
fn terminate(
&mut self,
_reason: OwnedTerm,
) -> impl Future<Output = ()> + Send + '_ { ... }
}Required Methods§
fn init( &mut self, args: Vec<OwnedTerm>, ) -> impl Future<Output = Result<()>> + Send + '_
fn handle_call( &mut self, msg: OwnedTerm, from: ExternalPid, ) -> impl Future<Output = Result<CallResult>> + Send + '_
fn handle_cast( &mut self, msg: OwnedTerm, ) -> impl Future<Output = Result<()>> + Send + '_
fn handle_info( &mut self, msg: OwnedTerm, ) -> impl Future<Output = Result<()>> + Send + '_
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.