pub enum WorkerMessage {
Show 29 variants
BackendNetworkInit(UniqueId),
BackendNetworkPointToPointInit {
from_stream: StreamRef,
to_stream: StreamRef,
},
CallFunction(CallFunctionParams),
CommandGroup(Vec<WorkerMessage>),
CreateStream {
id: StreamRef,
stream_creation: StreamCreationMode,
},
CreateDeviceMesh {
result: Ref,
names: Vec<String>,
ranks: Slice,
},
CreateRemoteProcessGroup {
result: Ref,
device_mesh: Ref,
dims: Vec<String>,
},
BorrowCreate {
result: Ref,
borrow: u64,
tensor: Ref,
from_stream: StreamRef,
to_stream: StreamRef,
},
BorrowFirstUse {
borrow: u64,
},
BorrowLastUse {
borrow: u64,
},
BorrowDrop {
borrow: u64,
},
DeleteRefs(Vec<Ref>),
RequestStatus {
seq: Seq,
controller: bool,
},
Reduce {
result: Ref,
tensor: Ref,
factory: Factory,
mesh: Ref,
stream: StreamRef,
dims: Vec<String>,
reduction: Reduction,
scatter: bool,
in_place: bool,
out: Option<Ref>,
},
SplitComm {
dims: Vec<String>,
device_mesh: Ref,
stream: StreamRef,
config: Option<NcclConfig>,
},
SplitCommForProcessGroup {
remote_process_group: Ref,
stream: StreamRef,
config: Option<NcclConfig>,
},
SendTensor {
result: Ref,
from_ranks: Slice,
to_ranks: Slice,
tensor: Ref,
factory: Factory,
from_stream: StreamRef,
to_stream: StreamRef,
},
CreatePipe {
result: Ref,
key: String,
function: ResolvableFunction,
max_messages: i64,
mesh: Ref,
args: Vec<WireValue>,
kwargs: HashMap<String, WireValue>,
},
SendValue {
seq: Seq,
destination: Option<Ref>,
mutates: Vec<Ref>,
function: Option<ResolvableFunction>,
args: Vec<WireValue>,
kwargs: HashMap<String, WireValue>,
stream: StreamRef,
},
SendResultOfActorCall(ActorCallParams),
CallActorMethod(ActorMethodParams),
PipeRecv {
seq: Seq,
results: Vec<Option<Ref>>,
pipe: Ref,
stream: StreamRef,
},
Exit {
error: Option<(Option<ActorId>, String)>,
},
DefineRecording {
result: Ref,
nresults: usize,
nformals: usize,
commands: Vec<WorkerMessage>,
ntotal_messages: usize,
index: usize,
},
RecordingFormal {
result: Ref,
argument_index: usize,
stream: StreamRef,
},
RecordingResult {
result: Ref,
output_index: usize,
stream: StreamRef,
},
CallRecording {
seq: Seq,
recording: Ref,
results: Vec<Ref>,
actuals: Vec<Ref>,
},
SetRefUnitTestsOnly {
reference: Ref,
value: WireValue,
stream: StreamRef,
},
GetRefUnitTestsOnly {
value: Ref,
stream: StreamRef,
response_port: OncePortRef<Option<Result<WireValue, String>>>,
},
}
Expand description
Worker messages. These define the observable behavior of the worker, so the documentations here
Variants§
BackendNetworkInit(UniqueId)
Initialize backend network state.
BackendNetworkPointToPointInit
Initialize backend network state for point-to-point communication.
CallFunction(CallFunctionParams)
Call a function, either a torch op or a Python remote_function
.
CommandGroup(Vec<WorkerMessage>)
Groups commands together; these commands will be executed in order by the worker.
CreateStream
Create a [Stream
] on the worker wih the provided id. Commands will be
generally be scheduled onto streams to run; different streams can
execute concurrently with one another.
Fields
stream_creation: StreamCreationMode
Whether to use the default device stream or create a new one.
CreateDeviceMesh
Create a [DeviceMesh
] on the worker, which can be used to schedule
efficient inter-worker communication.
CreateRemoteProcessGroup
Create a PyTorch distributed process group on the worker, which can be used to schedule collectives in UDFs using monarch communicators.
BorrowCreate
Create a borrow of a tensor from one stream to another.
Borrows allows streams to access tensors on another stream. The runtime will insert appropriate synchronization to ensure that cross-stream usage is safe.
Fields
BorrowFirstUse
First use of the borrow on the receiving stream. This is a marker for synchronization.
BorrowLastUse
Last use of the borrow on the receiving stream. This is a marker for synchronization.
BorrowDrop
Drop the borrow and free the resources associated with it.
DeleteRefs(Vec<Ref>)
Delete these refs from the worker state.
RequestStatus
A [ControllerMessage::Status
] will be send to the controller
when all streams have processed all the message sent before this one.
Reduce
Perform a reduction operation, using an efficient communication backend. Only NCCL is supported for now.
Fields
factory: Factory
Tensor metadata for tensor
that can be used to construct a
fresh tensor of appropriate size/shape. We use this if
tensor
isn’t accessible for some reason (like a previous
error on the worker).
SplitComm
Create a new communicator on each rank in ranks
, capable of
communicating with its peers along the specified dimensions.
Fields
dims: Vec<String>
The device mesh dimensions along which the constructed communicator should be able to exchange data.
device_mesh: Ref
The device mesh associated with the new communicator. One communicator will be created for every member of the mesh.
stream: StreamRef
The stream associated with the communicator. Communicator operations will be ordered with respect to other operations scheduled on this stream.
config: Option<NcclConfig>
Configuration for the new communicator. If None, we will not pass a config object to nccl, which means that the created communicator will inherit its parent’s config.
SplitCommForProcessGroup
Create a new communicator on each rank in ranks
, capable of
communicating with its peers along the specified dimensions.
Fields
remote_process_group: Ref
The device mesh associated with the new communicator. One communicator will be created for every member of the mesh.
stream: StreamRef
The stream associated with the communicator. Communicator operations will be ordered with respect to other operations scheduled on this stream.
config: Option<NcclConfig>
Configuration for the new communicator. If None, we will not pass a config object to nccl, which means that the created communicator will inherit its parent’s config.
SendTensor
Fields
CreatePipe
Fields
function: ResolvableFunction
SendValue
Fields
function: Option<ResolvableFunction>
Function to resolve the value to retrieve. If None
, then args
must contain the value as its only element and kwargs
must be
empty.
SendResultOfActorCall(ActorCallParams)
CallActorMethod(ActorMethodParams)
PipeRecv
Fields
Exit
Finish processing all messages previously sent to this worker and stop the actor loop. Any streams will also be drained.
Fields
DefineRecording
Defines (part of) a new recording on the worker. This is a list of commands
representing the execution of a function that was defined using
monarch.compile. If there are too many commands to send in a single
DefineRecording message, the commands may be chunked into ntotal_messages
,
with the index
field indicating how to order the DefineRecording messages
for a single recording.
Fields
commands: Vec<WorkerMessage>
The list of commands to run.
RecordingFormal
Defines an input tensor for a recording.
Fields
RecordingResult
Defines an output tensor for a recording.
Fields
CallRecording
Calls a recording that was previously defined using DefineRecording.
Fields
SetRefUnitTestsOnly
Fields
GetRefUnitTestsOnly
Implementations§
Source§impl WorkerMessage
impl WorkerMessage
Sourcepub fn is_backend_network_init(&self) -> bool
pub fn is_backend_network_init(&self) -> bool
Returns true if this is a WorkerMessage::BackendNetworkInit
, otherwise false
Sourcepub fn as_backend_network_init_mut(&mut self) -> Option<&mut UniqueId>
pub fn as_backend_network_init_mut(&mut self) -> Option<&mut UniqueId>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::BackendNetworkInit
, otherwise None
Sourcepub fn as_backend_network_init(&self) -> Option<&UniqueId>
pub fn as_backend_network_init(&self) -> Option<&UniqueId>
Optionally returns references to the inner fields if this is a WorkerMessage::BackendNetworkInit
, otherwise None
Sourcepub fn into_backend_network_init(self) -> Result<UniqueId, Self>
pub fn into_backend_network_init(self) -> Result<UniqueId, Self>
Returns the inner fields if this is a WorkerMessage::BackendNetworkInit
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_backend_network_point_to_point_init(&self) -> bool
pub fn is_backend_network_point_to_point_init(&self) -> bool
Returns true if this is a WorkerMessage::BackendNetworkPointToPointInit
, otherwise false
Sourcepub fn as_backend_network_point_to_point_init_mut(
&mut self,
) -> Option<(&mut StreamRef, &mut StreamRef)>
pub fn as_backend_network_point_to_point_init_mut( &mut self, ) -> Option<(&mut StreamRef, &mut StreamRef)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::BackendNetworkPointToPointInit
, otherwise None
Sourcepub fn as_backend_network_point_to_point_init(
&self,
) -> Option<(&StreamRef, &StreamRef)>
pub fn as_backend_network_point_to_point_init( &self, ) -> Option<(&StreamRef, &StreamRef)>
Optionally returns references to the inner fields if this is a WorkerMessage::BackendNetworkPointToPointInit
, otherwise None
Sourcepub fn into_backend_network_point_to_point_init(
self,
) -> Result<(StreamRef, StreamRef), Self>
pub fn into_backend_network_point_to_point_init( self, ) -> Result<(StreamRef, StreamRef), Self>
Returns the inner fields if this is a WorkerMessage::BackendNetworkPointToPointInit
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_call_function(&self) -> bool
pub fn is_call_function(&self) -> bool
Returns true if this is a WorkerMessage::CallFunction
, otherwise false
Sourcepub fn as_call_function_mut(&mut self) -> Option<&mut CallFunctionParams>
pub fn as_call_function_mut(&mut self) -> Option<&mut CallFunctionParams>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::CallFunction
, otherwise None
Sourcepub fn as_call_function(&self) -> Option<&CallFunctionParams>
pub fn as_call_function(&self) -> Option<&CallFunctionParams>
Optionally returns references to the inner fields if this is a WorkerMessage::CallFunction
, otherwise None
Sourcepub fn into_call_function(self) -> Result<CallFunctionParams, Self>
pub fn into_call_function(self) -> Result<CallFunctionParams, Self>
Returns the inner fields if this is a WorkerMessage::CallFunction
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_command_group(&self) -> bool
pub fn is_command_group(&self) -> bool
Returns true if this is a WorkerMessage::CommandGroup
, otherwise false
Sourcepub fn as_command_group_mut(&mut self) -> Option<&mut Vec<WorkerMessage>>
pub fn as_command_group_mut(&mut self) -> Option<&mut Vec<WorkerMessage>>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::CommandGroup
, otherwise None
Sourcepub fn as_command_group(&self) -> Option<&Vec<WorkerMessage>>
pub fn as_command_group(&self) -> Option<&Vec<WorkerMessage>>
Optionally returns references to the inner fields if this is a WorkerMessage::CommandGroup
, otherwise None
Sourcepub fn into_command_group(self) -> Result<Vec<WorkerMessage>, Self>
pub fn into_command_group(self) -> Result<Vec<WorkerMessage>, Self>
Returns the inner fields if this is a WorkerMessage::CommandGroup
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_create_stream(&self) -> bool
pub fn is_create_stream(&self) -> bool
Returns true if this is a WorkerMessage::CreateStream
, otherwise false
Sourcepub fn as_create_stream_mut(
&mut self,
) -> Option<(&mut StreamRef, &mut StreamCreationMode)>
pub fn as_create_stream_mut( &mut self, ) -> Option<(&mut StreamRef, &mut StreamCreationMode)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::CreateStream
, otherwise None
Sourcepub fn as_create_stream(&self) -> Option<(&StreamRef, &StreamCreationMode)>
pub fn as_create_stream(&self) -> Option<(&StreamRef, &StreamCreationMode)>
Optionally returns references to the inner fields if this is a WorkerMessage::CreateStream
, otherwise None
Sourcepub fn into_create_stream(self) -> Result<(StreamRef, StreamCreationMode), Self>
pub fn into_create_stream(self) -> Result<(StreamRef, StreamCreationMode), Self>
Returns the inner fields if this is a WorkerMessage::CreateStream
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_create_device_mesh(&self) -> bool
pub fn is_create_device_mesh(&self) -> bool
Returns true if this is a WorkerMessage::CreateDeviceMesh
, otherwise false
Sourcepub fn as_create_device_mesh_mut(
&mut self,
) -> Option<(&mut Ref, &mut Vec<String>, &mut Slice)>
pub fn as_create_device_mesh_mut( &mut self, ) -> Option<(&mut Ref, &mut Vec<String>, &mut Slice)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::CreateDeviceMesh
, otherwise None
Sourcepub fn as_create_device_mesh(&self) -> Option<(&Ref, &Vec<String>, &Slice)>
pub fn as_create_device_mesh(&self) -> Option<(&Ref, &Vec<String>, &Slice)>
Optionally returns references to the inner fields if this is a WorkerMessage::CreateDeviceMesh
, otherwise None
Sourcepub fn into_create_device_mesh(self) -> Result<(Ref, Vec<String>, Slice), Self>
pub fn into_create_device_mesh(self) -> Result<(Ref, Vec<String>, Slice), Self>
Returns the inner fields if this is a WorkerMessage::CreateDeviceMesh
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_create_remote_process_group(&self) -> bool
pub fn is_create_remote_process_group(&self) -> bool
Returns true if this is a WorkerMessage::CreateRemoteProcessGroup
, otherwise false
Sourcepub fn as_create_remote_process_group_mut(
&mut self,
) -> Option<(&mut Ref, &mut Ref, &mut Vec<String>)>
pub fn as_create_remote_process_group_mut( &mut self, ) -> Option<(&mut Ref, &mut Ref, &mut Vec<String>)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::CreateRemoteProcessGroup
, otherwise None
Sourcepub fn as_create_remote_process_group(
&self,
) -> Option<(&Ref, &Ref, &Vec<String>)>
pub fn as_create_remote_process_group( &self, ) -> Option<(&Ref, &Ref, &Vec<String>)>
Optionally returns references to the inner fields if this is a WorkerMessage::CreateRemoteProcessGroup
, otherwise None
Sourcepub fn into_create_remote_process_group(
self,
) -> Result<(Ref, Ref, Vec<String>), Self>
pub fn into_create_remote_process_group( self, ) -> Result<(Ref, Ref, Vec<String>), Self>
Returns the inner fields if this is a WorkerMessage::CreateRemoteProcessGroup
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_borrow_create(&self) -> bool
pub fn is_borrow_create(&self) -> bool
Returns true if this is a WorkerMessage::BorrowCreate
, otherwise false
Sourcepub fn as_borrow_create_mut(
&mut self,
) -> Option<(&mut Ref, &mut u64, &mut Ref, &mut StreamRef, &mut StreamRef)>
pub fn as_borrow_create_mut( &mut self, ) -> Option<(&mut Ref, &mut u64, &mut Ref, &mut StreamRef, &mut StreamRef)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::BorrowCreate
, otherwise None
Sourcepub fn as_borrow_create(
&self,
) -> Option<(&Ref, &u64, &Ref, &StreamRef, &StreamRef)>
pub fn as_borrow_create( &self, ) -> Option<(&Ref, &u64, &Ref, &StreamRef, &StreamRef)>
Optionally returns references to the inner fields if this is a WorkerMessage::BorrowCreate
, otherwise None
Sourcepub fn into_borrow_create(
self,
) -> Result<(Ref, u64, Ref, StreamRef, StreamRef), Self>
pub fn into_borrow_create( self, ) -> Result<(Ref, u64, Ref, StreamRef, StreamRef), Self>
Returns the inner fields if this is a WorkerMessage::BorrowCreate
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_borrow_first_use(&self) -> bool
pub fn is_borrow_first_use(&self) -> bool
Returns true if this is a WorkerMessage::BorrowFirstUse
, otherwise false
Sourcepub fn as_borrow_first_use_mut(&mut self) -> Option<&mut u64>
pub fn as_borrow_first_use_mut(&mut self) -> Option<&mut u64>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::BorrowFirstUse
, otherwise None
Sourcepub fn as_borrow_first_use(&self) -> Option<&u64>
pub fn as_borrow_first_use(&self) -> Option<&u64>
Optionally returns references to the inner fields if this is a WorkerMessage::BorrowFirstUse
, otherwise None
Sourcepub fn into_borrow_first_use(self) -> Result<u64, Self>
pub fn into_borrow_first_use(self) -> Result<u64, Self>
Returns the inner fields if this is a WorkerMessage::BorrowFirstUse
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_borrow_last_use(&self) -> bool
pub fn is_borrow_last_use(&self) -> bool
Returns true if this is a WorkerMessage::BorrowLastUse
, otherwise false
Sourcepub fn as_borrow_last_use_mut(&mut self) -> Option<&mut u64>
pub fn as_borrow_last_use_mut(&mut self) -> Option<&mut u64>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::BorrowLastUse
, otherwise None
Sourcepub fn as_borrow_last_use(&self) -> Option<&u64>
pub fn as_borrow_last_use(&self) -> Option<&u64>
Optionally returns references to the inner fields if this is a WorkerMessage::BorrowLastUse
, otherwise None
Sourcepub fn into_borrow_last_use(self) -> Result<u64, Self>
pub fn into_borrow_last_use(self) -> Result<u64, Self>
Returns the inner fields if this is a WorkerMessage::BorrowLastUse
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_borrow_drop(&self) -> bool
pub fn is_borrow_drop(&self) -> bool
Returns true if this is a WorkerMessage::BorrowDrop
, otherwise false
Sourcepub fn as_borrow_drop_mut(&mut self) -> Option<&mut u64>
pub fn as_borrow_drop_mut(&mut self) -> Option<&mut u64>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::BorrowDrop
, otherwise None
Sourcepub fn as_borrow_drop(&self) -> Option<&u64>
pub fn as_borrow_drop(&self) -> Option<&u64>
Optionally returns references to the inner fields if this is a WorkerMessage::BorrowDrop
, otherwise None
Sourcepub fn into_borrow_drop(self) -> Result<u64, Self>
pub fn into_borrow_drop(self) -> Result<u64, Self>
Returns the inner fields if this is a WorkerMessage::BorrowDrop
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_delete_refs(&self) -> bool
pub fn is_delete_refs(&self) -> bool
Returns true if this is a WorkerMessage::DeleteRefs
, otherwise false
Sourcepub fn as_delete_refs_mut(&mut self) -> Option<&mut Vec<Ref>>
pub fn as_delete_refs_mut(&mut self) -> Option<&mut Vec<Ref>>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::DeleteRefs
, otherwise None
Sourcepub fn as_delete_refs(&self) -> Option<&Vec<Ref>>
pub fn as_delete_refs(&self) -> Option<&Vec<Ref>>
Optionally returns references to the inner fields if this is a WorkerMessage::DeleteRefs
, otherwise None
Sourcepub fn into_delete_refs(self) -> Result<Vec<Ref>, Self>
pub fn into_delete_refs(self) -> Result<Vec<Ref>, Self>
Returns the inner fields if this is a WorkerMessage::DeleteRefs
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_request_status(&self) -> bool
pub fn is_request_status(&self) -> bool
Returns true if this is a WorkerMessage::RequestStatus
, otherwise false
Sourcepub fn as_request_status_mut(&mut self) -> Option<(&mut Seq, &mut bool)>
pub fn as_request_status_mut(&mut self) -> Option<(&mut Seq, &mut bool)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::RequestStatus
, otherwise None
Sourcepub fn as_request_status(&self) -> Option<(&Seq, &bool)>
pub fn as_request_status(&self) -> Option<(&Seq, &bool)>
Optionally returns references to the inner fields if this is a WorkerMessage::RequestStatus
, otherwise None
Sourcepub fn into_request_status(self) -> Result<(Seq, bool), Self>
pub fn into_request_status(self) -> Result<(Seq, bool), Self>
Returns the inner fields if this is a WorkerMessage::RequestStatus
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_reduce(&self) -> bool
pub fn is_reduce(&self) -> bool
Returns true if this is a WorkerMessage::Reduce
, otherwise false
Sourcepub fn as_reduce_mut(
&mut self,
) -> Option<(&mut Ref, &mut Ref, &mut Factory, &mut Ref, &mut StreamRef, &mut Vec<String>, &mut Reduction, &mut bool, &mut bool, &mut Option<Ref>)>
pub fn as_reduce_mut( &mut self, ) -> Option<(&mut Ref, &mut Ref, &mut Factory, &mut Ref, &mut StreamRef, &mut Vec<String>, &mut Reduction, &mut bool, &mut bool, &mut Option<Ref>)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::Reduce
, otherwise None
Sourcepub fn as_reduce(
&self,
) -> Option<(&Ref, &Ref, &Factory, &Ref, &StreamRef, &Vec<String>, &Reduction, &bool, &bool, &Option<Ref>)>
pub fn as_reduce( &self, ) -> Option<(&Ref, &Ref, &Factory, &Ref, &StreamRef, &Vec<String>, &Reduction, &bool, &bool, &Option<Ref>)>
Optionally returns references to the inner fields if this is a WorkerMessage::Reduce
, otherwise None
Sourcepub fn into_reduce(
self,
) -> Result<(Ref, Ref, Factory, Ref, StreamRef, Vec<String>, Reduction, bool, bool, Option<Ref>), Self>
pub fn into_reduce( self, ) -> Result<(Ref, Ref, Factory, Ref, StreamRef, Vec<String>, Reduction, bool, bool, Option<Ref>), Self>
Returns the inner fields if this is a WorkerMessage::Reduce
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_split_comm(&self) -> bool
pub fn is_split_comm(&self) -> bool
Returns true if this is a WorkerMessage::SplitComm
, otherwise false
Sourcepub fn as_split_comm_mut(
&mut self,
) -> Option<(&mut Vec<String>, &mut Ref, &mut StreamRef, &mut Option<NcclConfig>)>
pub fn as_split_comm_mut( &mut self, ) -> Option<(&mut Vec<String>, &mut Ref, &mut StreamRef, &mut Option<NcclConfig>)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::SplitComm
, otherwise None
Sourcepub fn as_split_comm(
&self,
) -> Option<(&Vec<String>, &Ref, &StreamRef, &Option<NcclConfig>)>
pub fn as_split_comm( &self, ) -> Option<(&Vec<String>, &Ref, &StreamRef, &Option<NcclConfig>)>
Optionally returns references to the inner fields if this is a WorkerMessage::SplitComm
, otherwise None
Sourcepub fn into_split_comm(
self,
) -> Result<(Vec<String>, Ref, StreamRef, Option<NcclConfig>), Self>
pub fn into_split_comm( self, ) -> Result<(Vec<String>, Ref, StreamRef, Option<NcclConfig>), Self>
Returns the inner fields if this is a WorkerMessage::SplitComm
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_split_comm_for_process_group(&self) -> bool
pub fn is_split_comm_for_process_group(&self) -> bool
Returns true if this is a WorkerMessage::SplitCommForProcessGroup
, otherwise false
Sourcepub fn as_split_comm_for_process_group_mut(
&mut self,
) -> Option<(&mut Ref, &mut StreamRef, &mut Option<NcclConfig>)>
pub fn as_split_comm_for_process_group_mut( &mut self, ) -> Option<(&mut Ref, &mut StreamRef, &mut Option<NcclConfig>)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::SplitCommForProcessGroup
, otherwise None
Sourcepub fn as_split_comm_for_process_group(
&self,
) -> Option<(&Ref, &StreamRef, &Option<NcclConfig>)>
pub fn as_split_comm_for_process_group( &self, ) -> Option<(&Ref, &StreamRef, &Option<NcclConfig>)>
Optionally returns references to the inner fields if this is a WorkerMessage::SplitCommForProcessGroup
, otherwise None
Sourcepub fn into_split_comm_for_process_group(
self,
) -> Result<(Ref, StreamRef, Option<NcclConfig>), Self>
pub fn into_split_comm_for_process_group( self, ) -> Result<(Ref, StreamRef, Option<NcclConfig>), Self>
Returns the inner fields if this is a WorkerMessage::SplitCommForProcessGroup
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_send_tensor(&self) -> bool
pub fn is_send_tensor(&self) -> bool
Returns true if this is a WorkerMessage::SendTensor
, otherwise false
Sourcepub fn as_send_tensor_mut(
&mut self,
) -> Option<(&mut Ref, &mut Slice, &mut Slice, &mut Ref, &mut Factory, &mut StreamRef, &mut StreamRef)>
pub fn as_send_tensor_mut( &mut self, ) -> Option<(&mut Ref, &mut Slice, &mut Slice, &mut Ref, &mut Factory, &mut StreamRef, &mut StreamRef)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::SendTensor
, otherwise None
Sourcepub fn as_send_tensor(
&self,
) -> Option<(&Ref, &Slice, &Slice, &Ref, &Factory, &StreamRef, &StreamRef)>
pub fn as_send_tensor( &self, ) -> Option<(&Ref, &Slice, &Slice, &Ref, &Factory, &StreamRef, &StreamRef)>
Optionally returns references to the inner fields if this is a WorkerMessage::SendTensor
, otherwise None
Sourcepub fn into_send_tensor(
self,
) -> Result<(Ref, Slice, Slice, Ref, Factory, StreamRef, StreamRef), Self>
pub fn into_send_tensor( self, ) -> Result<(Ref, Slice, Slice, Ref, Factory, StreamRef, StreamRef), Self>
Returns the inner fields if this is a WorkerMessage::SendTensor
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_create_pipe(&self) -> bool
pub fn is_create_pipe(&self) -> bool
Returns true if this is a WorkerMessage::CreatePipe
, otherwise false
Sourcepub fn as_create_pipe_mut(
&mut self,
) -> Option<(&mut Ref, &mut String, &mut ResolvableFunction, &mut i64, &mut Ref, &mut Vec<WireValue>, &mut HashMap<String, WireValue>)>
pub fn as_create_pipe_mut( &mut self, ) -> Option<(&mut Ref, &mut String, &mut ResolvableFunction, &mut i64, &mut Ref, &mut Vec<WireValue>, &mut HashMap<String, WireValue>)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::CreatePipe
, otherwise None
Sourcepub fn as_create_pipe(
&self,
) -> Option<(&Ref, &String, &ResolvableFunction, &i64, &Ref, &Vec<WireValue>, &HashMap<String, WireValue>)>
pub fn as_create_pipe( &self, ) -> Option<(&Ref, &String, &ResolvableFunction, &i64, &Ref, &Vec<WireValue>, &HashMap<String, WireValue>)>
Optionally returns references to the inner fields if this is a WorkerMessage::CreatePipe
, otherwise None
Sourcepub fn into_create_pipe(
self,
) -> Result<(Ref, String, ResolvableFunction, i64, Ref, Vec<WireValue>, HashMap<String, WireValue>), Self>
pub fn into_create_pipe( self, ) -> Result<(Ref, String, ResolvableFunction, i64, Ref, Vec<WireValue>, HashMap<String, WireValue>), Self>
Returns the inner fields if this is a WorkerMessage::CreatePipe
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_send_value(&self) -> bool
pub fn is_send_value(&self) -> bool
Returns true if this is a WorkerMessage::SendValue
, otherwise false
Sourcepub fn as_send_value_mut(
&mut self,
) -> Option<(&mut Seq, &mut Option<Ref>, &mut Vec<Ref>, &mut Option<ResolvableFunction>, &mut Vec<WireValue>, &mut HashMap<String, WireValue>, &mut StreamRef)>
pub fn as_send_value_mut( &mut self, ) -> Option<(&mut Seq, &mut Option<Ref>, &mut Vec<Ref>, &mut Option<ResolvableFunction>, &mut Vec<WireValue>, &mut HashMap<String, WireValue>, &mut StreamRef)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::SendValue
, otherwise None
Sourcepub fn as_send_value(
&self,
) -> Option<(&Seq, &Option<Ref>, &Vec<Ref>, &Option<ResolvableFunction>, &Vec<WireValue>, &HashMap<String, WireValue>, &StreamRef)>
pub fn as_send_value( &self, ) -> Option<(&Seq, &Option<Ref>, &Vec<Ref>, &Option<ResolvableFunction>, &Vec<WireValue>, &HashMap<String, WireValue>, &StreamRef)>
Optionally returns references to the inner fields if this is a WorkerMessage::SendValue
, otherwise None
Sourcepub fn into_send_value(
self,
) -> Result<(Seq, Option<Ref>, Vec<Ref>, Option<ResolvableFunction>, Vec<WireValue>, HashMap<String, WireValue>, StreamRef), Self>
pub fn into_send_value( self, ) -> Result<(Seq, Option<Ref>, Vec<Ref>, Option<ResolvableFunction>, Vec<WireValue>, HashMap<String, WireValue>, StreamRef), Self>
Returns the inner fields if this is a WorkerMessage::SendValue
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_send_result_of_actor_call(&self) -> bool
pub fn is_send_result_of_actor_call(&self) -> bool
Returns true if this is a WorkerMessage::SendResultOfActorCall
, otherwise false
Sourcepub fn as_send_result_of_actor_call_mut(
&mut self,
) -> Option<&mut ActorCallParams>
pub fn as_send_result_of_actor_call_mut( &mut self, ) -> Option<&mut ActorCallParams>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::SendResultOfActorCall
, otherwise None
Sourcepub fn as_send_result_of_actor_call(&self) -> Option<&ActorCallParams>
pub fn as_send_result_of_actor_call(&self) -> Option<&ActorCallParams>
Optionally returns references to the inner fields if this is a WorkerMessage::SendResultOfActorCall
, otherwise None
Sourcepub fn into_send_result_of_actor_call(self) -> Result<ActorCallParams, Self>
pub fn into_send_result_of_actor_call(self) -> Result<ActorCallParams, Self>
Returns the inner fields if this is a WorkerMessage::SendResultOfActorCall
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_call_actor_method(&self) -> bool
pub fn is_call_actor_method(&self) -> bool
Returns true if this is a WorkerMessage::CallActorMethod
, otherwise false
Sourcepub fn as_call_actor_method_mut(&mut self) -> Option<&mut ActorMethodParams>
pub fn as_call_actor_method_mut(&mut self) -> Option<&mut ActorMethodParams>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::CallActorMethod
, otherwise None
Sourcepub fn as_call_actor_method(&self) -> Option<&ActorMethodParams>
pub fn as_call_actor_method(&self) -> Option<&ActorMethodParams>
Optionally returns references to the inner fields if this is a WorkerMessage::CallActorMethod
, otherwise None
Sourcepub fn into_call_actor_method(self) -> Result<ActorMethodParams, Self>
pub fn into_call_actor_method(self) -> Result<ActorMethodParams, Self>
Returns the inner fields if this is a WorkerMessage::CallActorMethod
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_pipe_recv(&self) -> bool
pub fn is_pipe_recv(&self) -> bool
Returns true if this is a WorkerMessage::PipeRecv
, otherwise false
Sourcepub fn as_pipe_recv_mut(
&mut self,
) -> Option<(&mut Seq, &mut Vec<Option<Ref>>, &mut Ref, &mut StreamRef)>
pub fn as_pipe_recv_mut( &mut self, ) -> Option<(&mut Seq, &mut Vec<Option<Ref>>, &mut Ref, &mut StreamRef)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::PipeRecv
, otherwise None
Sourcepub fn as_pipe_recv(
&self,
) -> Option<(&Seq, &Vec<Option<Ref>>, &Ref, &StreamRef)>
pub fn as_pipe_recv( &self, ) -> Option<(&Seq, &Vec<Option<Ref>>, &Ref, &StreamRef)>
Optionally returns references to the inner fields if this is a WorkerMessage::PipeRecv
, otherwise None
Sourcepub fn into_pipe_recv(
self,
) -> Result<(Seq, Vec<Option<Ref>>, Ref, StreamRef), Self>
pub fn into_pipe_recv( self, ) -> Result<(Seq, Vec<Option<Ref>>, Ref, StreamRef), Self>
Returns the inner fields if this is a WorkerMessage::PipeRecv
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_exit_mut(&mut self) -> Option<&mut Option<(Option<ActorId>, String)>>
pub fn as_exit_mut(&mut self) -> Option<&mut Option<(Option<ActorId>, String)>>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::Exit
, otherwise None
Sourcepub fn as_exit(&self) -> Option<&Option<(Option<ActorId>, String)>>
pub fn as_exit(&self) -> Option<&Option<(Option<ActorId>, String)>>
Optionally returns references to the inner fields if this is a WorkerMessage::Exit
, otherwise None
Sourcepub fn into_exit(self) -> Result<Option<(Option<ActorId>, String)>, Self>
pub fn into_exit(self) -> Result<Option<(Option<ActorId>, String)>, Self>
Returns the inner fields if this is a WorkerMessage::Exit
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_define_recording(&self) -> bool
pub fn is_define_recording(&self) -> bool
Returns true if this is a WorkerMessage::DefineRecording
, otherwise false
Sourcepub fn as_define_recording_mut(
&mut self,
) -> Option<(&mut Ref, &mut usize, &mut usize, &mut Vec<WorkerMessage>, &mut usize, &mut usize)>
pub fn as_define_recording_mut( &mut self, ) -> Option<(&mut Ref, &mut usize, &mut usize, &mut Vec<WorkerMessage>, &mut usize, &mut usize)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::DefineRecording
, otherwise None
Sourcepub fn as_define_recording(
&self,
) -> Option<(&Ref, &usize, &usize, &Vec<WorkerMessage>, &usize, &usize)>
pub fn as_define_recording( &self, ) -> Option<(&Ref, &usize, &usize, &Vec<WorkerMessage>, &usize, &usize)>
Optionally returns references to the inner fields if this is a WorkerMessage::DefineRecording
, otherwise None
Sourcepub fn into_define_recording(
self,
) -> Result<(Ref, usize, usize, Vec<WorkerMessage>, usize, usize), Self>
pub fn into_define_recording( self, ) -> Result<(Ref, usize, usize, Vec<WorkerMessage>, usize, usize), Self>
Returns the inner fields if this is a WorkerMessage::DefineRecording
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_recording_formal(&self) -> bool
pub fn is_recording_formal(&self) -> bool
Returns true if this is a WorkerMessage::RecordingFormal
, otherwise false
Sourcepub fn as_recording_formal_mut(
&mut self,
) -> Option<(&mut Ref, &mut usize, &mut StreamRef)>
pub fn as_recording_formal_mut( &mut self, ) -> Option<(&mut Ref, &mut usize, &mut StreamRef)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::RecordingFormal
, otherwise None
Sourcepub fn as_recording_formal(&self) -> Option<(&Ref, &usize, &StreamRef)>
pub fn as_recording_formal(&self) -> Option<(&Ref, &usize, &StreamRef)>
Optionally returns references to the inner fields if this is a WorkerMessage::RecordingFormal
, otherwise None
Sourcepub fn into_recording_formal(self) -> Result<(Ref, usize, StreamRef), Self>
pub fn into_recording_formal(self) -> Result<(Ref, usize, StreamRef), Self>
Returns the inner fields if this is a WorkerMessage::RecordingFormal
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_recording_result(&self) -> bool
pub fn is_recording_result(&self) -> bool
Returns true if this is a WorkerMessage::RecordingResult
, otherwise false
Sourcepub fn as_recording_result_mut(
&mut self,
) -> Option<(&mut Ref, &mut usize, &mut StreamRef)>
pub fn as_recording_result_mut( &mut self, ) -> Option<(&mut Ref, &mut usize, &mut StreamRef)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::RecordingResult
, otherwise None
Sourcepub fn as_recording_result(&self) -> Option<(&Ref, &usize, &StreamRef)>
pub fn as_recording_result(&self) -> Option<(&Ref, &usize, &StreamRef)>
Optionally returns references to the inner fields if this is a WorkerMessage::RecordingResult
, otherwise None
Sourcepub fn into_recording_result(self) -> Result<(Ref, usize, StreamRef), Self>
pub fn into_recording_result(self) -> Result<(Ref, usize, StreamRef), Self>
Returns the inner fields if this is a WorkerMessage::RecordingResult
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_call_recording(&self) -> bool
pub fn is_call_recording(&self) -> bool
Returns true if this is a WorkerMessage::CallRecording
, otherwise false
Sourcepub fn as_call_recording_mut(
&mut self,
) -> Option<(&mut Seq, &mut Ref, &mut Vec<Ref>, &mut Vec<Ref>)>
pub fn as_call_recording_mut( &mut self, ) -> Option<(&mut Seq, &mut Ref, &mut Vec<Ref>, &mut Vec<Ref>)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::CallRecording
, otherwise None
Sourcepub fn as_call_recording(&self) -> Option<(&Seq, &Ref, &Vec<Ref>, &Vec<Ref>)>
pub fn as_call_recording(&self) -> Option<(&Seq, &Ref, &Vec<Ref>, &Vec<Ref>)>
Optionally returns references to the inner fields if this is a WorkerMessage::CallRecording
, otherwise None
Sourcepub fn into_call_recording(self) -> Result<(Seq, Ref, Vec<Ref>, Vec<Ref>), Self>
pub fn into_call_recording(self) -> Result<(Seq, Ref, Vec<Ref>, Vec<Ref>), Self>
Returns the inner fields if this is a WorkerMessage::CallRecording
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_set_ref_unit_tests_only(&self) -> bool
pub fn is_set_ref_unit_tests_only(&self) -> bool
Returns true if this is a WorkerMessage::SetRefUnitTestsOnly
, otherwise false
Sourcepub fn as_set_ref_unit_tests_only_mut(
&mut self,
) -> Option<(&mut Ref, &mut WireValue, &mut StreamRef)>
pub fn as_set_ref_unit_tests_only_mut( &mut self, ) -> Option<(&mut Ref, &mut WireValue, &mut StreamRef)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::SetRefUnitTestsOnly
, otherwise None
Sourcepub fn as_set_ref_unit_tests_only(
&self,
) -> Option<(&Ref, &WireValue, &StreamRef)>
pub fn as_set_ref_unit_tests_only( &self, ) -> Option<(&Ref, &WireValue, &StreamRef)>
Optionally returns references to the inner fields if this is a WorkerMessage::SetRefUnitTestsOnly
, otherwise None
Sourcepub fn into_set_ref_unit_tests_only(
self,
) -> Result<(Ref, WireValue, StreamRef), Self>
pub fn into_set_ref_unit_tests_only( self, ) -> Result<(Ref, WireValue, StreamRef), Self>
Returns the inner fields if this is a WorkerMessage::SetRefUnitTestsOnly
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_get_ref_unit_tests_only(&self) -> bool
pub fn is_get_ref_unit_tests_only(&self) -> bool
Returns true if this is a WorkerMessage::GetRefUnitTestsOnly
, otherwise false
Sourcepub fn as_get_ref_unit_tests_only_mut(
&mut self,
) -> Option<(&mut Ref, &mut StreamRef, &mut OncePortRef<Option<Result<WireValue, String>>>)>
pub fn as_get_ref_unit_tests_only_mut( &mut self, ) -> Option<(&mut Ref, &mut StreamRef, &mut OncePortRef<Option<Result<WireValue, String>>>)>
Optionally returns mutable references to the inner fields if this is a WorkerMessage::GetRefUnitTestsOnly
, otherwise None
Sourcepub fn as_get_ref_unit_tests_only(
&self,
) -> Option<(&Ref, &StreamRef, &OncePortRef<Option<Result<WireValue, String>>>)>
pub fn as_get_ref_unit_tests_only( &self, ) -> Option<(&Ref, &StreamRef, &OncePortRef<Option<Result<WireValue, String>>>)>
Optionally returns references to the inner fields if this is a WorkerMessage::GetRefUnitTestsOnly
, otherwise None
Sourcepub fn into_get_ref_unit_tests_only(
self,
) -> Result<(Ref, StreamRef, OncePortRef<Option<Result<WireValue, String>>>), Self>
pub fn into_get_ref_unit_tests_only( self, ) -> Result<(Ref, StreamRef, OncePortRef<Option<Result<WireValue, String>>>), Self>
Returns the inner fields if this is a WorkerMessage::GetRefUnitTestsOnly
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
Source§impl Bind for WorkerMessage
impl Bind for WorkerMessage
Source§impl Clone for WorkerMessage
impl Clone for WorkerMessage
Source§fn clone(&self) -> WorkerMessage
fn clone(&self) -> WorkerMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for WorkerMessage
impl Debug for WorkerMessage
Source§impl<'de> Deserialize<'de> for WorkerMessage
impl<'de> Deserialize<'de> for WorkerMessage
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 WorkerMessage
impl Named for WorkerMessage
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 WorkerMessage
impl Serialize for WorkerMessage
Source§impl Unbind for WorkerMessage
impl Unbind for WorkerMessage
impl RemoteHandles<WorkerMessage> for WorkerActor
Auto Trait Implementations§
impl Freeze for WorkerMessage
impl RefUnwindSafe for WorkerMessage
impl Send for WorkerMessage
impl Sync for WorkerMessage
impl Unpin for WorkerMessage
impl UnwindSafe for WorkerMessage
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