pub enum ClientMessage {
Result {
seq: Seq,
result: Option<Result<Serialized, Exception>>,
},
Log {
level: LogLevel,
message: String,
},
DebuggerMessage {
debugger_actor_id: ActorId,
action: DebuggerAction,
},
}
Expand description
Client messages. These define the messages that the controller can send to the client. The actual handling of these messages will be defined on the python side in the client implementation.
Variants§
Result
A fetched result of an invoked operation.
Log
Notify the client of an event.
DebuggerMessage
Notify the client of a debugger event.
Fields
action: DebuggerAction
The action to take.
Implementations§
Source§impl ClientMessage
impl ClientMessage
Sourcepub fn is_result(&self) -> bool
pub fn is_result(&self) -> bool
Returns true if this is a ClientMessage::Result
, otherwise false
Sourcepub fn as_result_mut(
&mut self,
) -> Option<(&mut Seq, &mut Option<Result<Serialized, Exception>>)>
pub fn as_result_mut( &mut self, ) -> Option<(&mut Seq, &mut Option<Result<Serialized, Exception>>)>
Optionally returns mutable references to the inner fields if this is a ClientMessage::Result
, otherwise None
Sourcepub fn as_result(
&self,
) -> Option<(&Seq, &Option<Result<Serialized, Exception>>)>
pub fn as_result( &self, ) -> Option<(&Seq, &Option<Result<Serialized, Exception>>)>
Optionally returns references to the inner fields if this is a ClientMessage::Result
, otherwise None
Sourcepub fn into_result(
self,
) -> Result<(Seq, Option<Result<Serialized, Exception>>), Self>
pub fn into_result( self, ) -> Result<(Seq, Option<Result<Serialized, Exception>>), Self>
Returns the inner fields if this is a ClientMessage::Result
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_log_mut(&mut self) -> Option<(&mut LogLevel, &mut String)>
pub fn as_log_mut(&mut self) -> Option<(&mut LogLevel, &mut String)>
Optionally returns mutable references to the inner fields if this is a ClientMessage::Log
, otherwise None
Sourcepub fn as_log(&self) -> Option<(&LogLevel, &String)>
pub fn as_log(&self) -> Option<(&LogLevel, &String)>
Optionally returns references to the inner fields if this is a ClientMessage::Log
, otherwise None
Sourcepub fn into_log(self) -> Result<(LogLevel, String), Self>
pub fn into_log(self) -> Result<(LogLevel, String), Self>
Returns the inner fields if this is a ClientMessage::Log
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_debugger_message(&self) -> bool
pub fn is_debugger_message(&self) -> bool
Returns true if this is a ClientMessage::DebuggerMessage
, otherwise false
Sourcepub fn as_debugger_message_mut(
&mut self,
) -> Option<(&mut ActorId, &mut DebuggerAction)>
pub fn as_debugger_message_mut( &mut self, ) -> Option<(&mut ActorId, &mut DebuggerAction)>
Optionally returns mutable references to the inner fields if this is a ClientMessage::DebuggerMessage
, otherwise None
Sourcepub fn as_debugger_message(&self) -> Option<(&ActorId, &DebuggerAction)>
pub fn as_debugger_message(&self) -> Option<(&ActorId, &DebuggerAction)>
Optionally returns references to the inner fields if this is a ClientMessage::DebuggerMessage
, otherwise None
Sourcepub fn into_debugger_message(self) -> Result<(ActorId, DebuggerAction), Self>
pub fn into_debugger_message(self) -> Result<(ActorId, DebuggerAction), Self>
Returns the inner fields if this is a ClientMessage::DebuggerMessage
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
Source§impl Clone for ClientMessage
impl Clone for ClientMessage
Source§fn clone(&self) -> ClientMessage
fn clone(&self) -> ClientMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ClientMessage
impl Debug for ClientMessage
Source§impl<'de> Deserialize<'de> for ClientMessage
impl<'de> Deserialize<'de> for ClientMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Named for ClientMessage
impl Named for ClientMessage
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn arm(&self) -> Option<&'static str>
fn arm(&self) -> Option<&'static str>
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
Source§impl Serialize for ClientMessage
impl Serialize for ClientMessage
impl RemoteHandles<ClientMessage> for ClientActor
Auto Trait Implementations§
impl !Freeze for ClientMessage
impl RefUnwindSafe for ClientMessage
impl Send for ClientMessage
impl Sync for ClientMessage
impl Unpin for ClientMessage
impl UnwindSafe for ClientMessage
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
Source§impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
Source§type State = T
type State = T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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