Enum WorkerMessage

Source
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.

Fields

§from_stream: StreamRef
§to_stream: StreamRef
§

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

§id: StreamRef

Id of the stream to create.

§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.

Fields

§result: Ref
§names: Vec<String>
§ranks: Slice
§

CreateRemoteProcessGroup

Create a PyTorch distributed process group on the worker, which can be used to schedule collectives in UDFs using monarch communicators.

Fields

§result: Ref
§device_mesh: Ref
§dims: Vec<String>
§

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

§result: Ref

Ref of the resulting borrowed tensor

§borrow: u64

Id for the borrow

§tensor: Ref

Tensor to borrow

§from_stream: StreamRef

Stream to borrow from

§to_stream: StreamRef

Stream to borrow to

§

BorrowFirstUse

First use of the borrow on the receiving stream. This is a marker for synchronization.

Fields

§borrow: u64
§

BorrowLastUse

Last use of the borrow on the receiving stream. This is a marker for synchronization.

Fields

§borrow: u64
§

BorrowDrop

Drop the borrow and free the resources associated with it.

Fields

§borrow: u64
§

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.

Fields

§seq: Seq
§controller: bool
§

Reduce

Perform a reduction operation, using an efficient communication backend. Only NCCL is supported for now.

Fields

§result: Ref

Where to store the result of the reduction.

§tensor: Ref

The tensor to reduce.

§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).

§mesh: Ref

The device mesh on which to perform the reduction.

§stream: StreamRef

The stream to call the reduction on.

§dims: Vec<String>

The dimensions of the device mesh to reduce over. The members of these dimension will form the members of the reduction collective.

§reduction: Reduction

What kind of reduction to perform.

§scatter: bool

If true, the reduced result will be evenly split across the tensors of dim.

§in_place: bool

If true, the reduction will be performed in-place on tensor.

§out: Option<Ref>

Pre-existing tensor that should be used as the output for the reduction.

§

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

§result: Ref
§from_ranks: Slice
§to_ranks: Slice
§tensor: Ref
§factory: Factory
§from_stream: StreamRef
§to_stream: StreamRef
§

CreatePipe

Fields

§result: Ref
§max_messages: i64
§mesh: Ref
§

SendValue

Fields

§seq: Seq
§destination: Option<Ref>

Pipe to send value to. If None, value is sent to controller.

§mutates: Vec<Ref>
§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.

§stream: StreamRef

The stream to retrieve from.

§

SendResultOfActorCall(ActorCallParams)

§

CallActorMethod(ActorMethodParams)

§

PipeRecv

Fields

§seq: Seq
§results: Vec<Option<Ref>>

Result refs.

§pipe: Ref

Pipe to receive value from.

§stream: StreamRef

The stream to retrieve from.

§

Exit

Finish processing all messages previously sent to this worker and stop the actor loop. Any streams will also be drained.

Fields

§error: Option<(Option<ActorId>, String)>

Optional error reason if the exit is the result of an error, including

  • optional actor id to indicate the source of the error
  • error message or stacktrace The worker process will be stopped if the error is provided.
§

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

§result: Ref

The ref associated with this recording that will be used to call it in the future.

§nresults: usize

The number of output tensors.

§nformals: usize

The number of input tensors.

§commands: Vec<WorkerMessage>

The list of commands to run.

§ntotal_messages: usize

How many total DefineRecording messages make up this recording.

§index: usize

This DefineRecording message’s index in the set of messages that make up this recording.

§

RecordingFormal

Defines an input tensor for a recording.

Fields

§result: Ref

The ref that will be used to pass the input tensor to the recording.

§argument_index: usize

The index of the input tensor in the list of input tensors.

§stream: StreamRef

The stream that this input tensor will be used on.

§

RecordingResult

Defines an output tensor for a recording.

Fields

§result: Ref

The ref that will be used to store the output tensor.

§output_index: usize

The index of the output tensor in the list of output tensors.

§stream: StreamRef

The stream that this output tensor will come from.

§

CallRecording

Calls a recording that was previously defined using DefineRecording.

Fields

§seq: Seq

The sequence number of the invocation.

§recording: Ref

The ref of the recording to call.

§results: Vec<Ref>

The list of refs where the result tensors from the recording will be stored.

§actuals: Vec<Ref>

The list of refs of input tensors to the recording.

§

SetRefUnitTestsOnly

Fields

§reference: Ref

The reference to set.

§value: WireValue

The value to set it with.

§stream: StreamRef

The stream to set it on.

§

GetRefUnitTestsOnly

Fields

§value: Ref

The value to retrieve, expected to be a bool.

§stream: StreamRef

The stream to retrieve from.

Implementations§

Source§

impl WorkerMessage

Source

pub fn is_backend_network_init(&self) -> bool

Returns true if this is a WorkerMessage::BackendNetworkInit, otherwise false

Source

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

Source

pub fn as_backend_network_init(&self) -> Option<&UniqueId>

Optionally returns references to the inner fields if this is a WorkerMessage::BackendNetworkInit, otherwise None

Source

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

Source

pub fn is_backend_network_point_to_point_init(&self) -> bool

Returns true if this is a WorkerMessage::BackendNetworkPointToPointInit, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_call_function(&self) -> bool

Returns true if this is a WorkerMessage::CallFunction, otherwise false

Source

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

Source

pub fn as_call_function(&self) -> Option<&CallFunctionParams>

Optionally returns references to the inner fields if this is a WorkerMessage::CallFunction, otherwise None

Source

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

Source

pub fn is_command_group(&self) -> bool

Returns true if this is a WorkerMessage::CommandGroup, otherwise false

Source

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

Source

pub fn as_command_group(&self) -> Option<&Vec<WorkerMessage>>

Optionally returns references to the inner fields if this is a WorkerMessage::CommandGroup, otherwise None

Source

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

Source

pub fn is_create_stream(&self) -> bool

Returns true if this is a WorkerMessage::CreateStream, otherwise false

Source

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

Source

pub fn as_create_stream(&self) -> Option<(&StreamRef, &StreamCreationMode)>

Optionally returns references to the inner fields if this is a WorkerMessage::CreateStream, otherwise None

Source

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

Source

pub fn is_create_device_mesh(&self) -> bool

Returns true if this is a WorkerMessage::CreateDeviceMesh, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_create_remote_process_group(&self) -> bool

Returns true if this is a WorkerMessage::CreateRemoteProcessGroup, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_borrow_create(&self) -> bool

Returns true if this is a WorkerMessage::BorrowCreate, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_borrow_first_use(&self) -> bool

Returns true if this is a WorkerMessage::BorrowFirstUse, otherwise false

Source

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

Source

pub fn as_borrow_first_use(&self) -> Option<&u64>

Optionally returns references to the inner fields if this is a WorkerMessage::BorrowFirstUse, otherwise None

Source

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

Source

pub fn is_borrow_last_use(&self) -> bool

Returns true if this is a WorkerMessage::BorrowLastUse, otherwise false

Source

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

Source

pub fn as_borrow_last_use(&self) -> Option<&u64>

Optionally returns references to the inner fields if this is a WorkerMessage::BorrowLastUse, otherwise None

Source

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

Source

pub fn is_borrow_drop(&self) -> bool

Returns true if this is a WorkerMessage::BorrowDrop, otherwise false

Source

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

Source

pub fn as_borrow_drop(&self) -> Option<&u64>

Optionally returns references to the inner fields if this is a WorkerMessage::BorrowDrop, otherwise None

Source

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

Source

pub fn is_delete_refs(&self) -> bool

Returns true if this is a WorkerMessage::DeleteRefs, otherwise false

Source

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

Source

pub fn as_delete_refs(&self) -> Option<&Vec<Ref>>

Optionally returns references to the inner fields if this is a WorkerMessage::DeleteRefs, otherwise None

Source

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

Source

pub fn is_request_status(&self) -> bool

Returns true if this is a WorkerMessage::RequestStatus, otherwise false

Source

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

Source

pub fn as_request_status(&self) -> Option<(&Seq, &bool)>

Optionally returns references to the inner fields if this is a WorkerMessage::RequestStatus, otherwise None

Source

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

Source

pub fn is_reduce(&self) -> bool

Returns true if this is a WorkerMessage::Reduce, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_split_comm(&self) -> bool

Returns true if this is a WorkerMessage::SplitComm, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_split_comm_for_process_group(&self) -> bool

Returns true if this is a WorkerMessage::SplitCommForProcessGroup, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_send_tensor(&self) -> bool

Returns true if this is a WorkerMessage::SendTensor, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_create_pipe(&self) -> bool

Returns true if this is a WorkerMessage::CreatePipe, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_send_value(&self) -> bool

Returns true if this is a WorkerMessage::SendValue, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_send_result_of_actor_call(&self) -> bool

Returns true if this is a WorkerMessage::SendResultOfActorCall, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_call_actor_method(&self) -> bool

Returns true if this is a WorkerMessage::CallActorMethod, otherwise false

Source

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

Source

pub fn as_call_actor_method(&self) -> Option<&ActorMethodParams>

Optionally returns references to the inner fields if this is a WorkerMessage::CallActorMethod, otherwise None

Source

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

Source

pub fn is_pipe_recv(&self) -> bool

Returns true if this is a WorkerMessage::PipeRecv, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_exit(&self) -> bool

Returns true if this is a WorkerMessage::Exit, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_define_recording(&self) -> bool

Returns true if this is a WorkerMessage::DefineRecording, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_recording_formal(&self) -> bool

Returns true if this is a WorkerMessage::RecordingFormal, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_recording_result(&self) -> bool

Returns true if this is a WorkerMessage::RecordingResult, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_call_recording(&self) -> bool

Returns true if this is a WorkerMessage::CallRecording, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_set_ref_unit_tests_only(&self) -> bool

Returns true if this is a WorkerMessage::SetRefUnitTestsOnly, otherwise false

Source

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

Source

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

Source

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

Source

pub fn is_get_ref_unit_tests_only(&self) -> bool

Returns true if this is a WorkerMessage::GetRefUnitTestsOnly, otherwise false

Source

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

Source

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

Source

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

Source§

fn bind(&mut self, bindings: &mut Bindings) -> Result<()>

Remove parameters from bindings, and use them to update itself.
Source§

impl Clone for WorkerMessage

Source§

fn clone(&self) -> WorkerMessage

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WorkerMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for WorkerMessage

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Named for WorkerMessage

Source§

fn typename() -> &'static str

The globally unique type name for the type. This should typically be the fully qualified Rust name of the type.
Source§

fn typehash() -> u64

A globally unique hash for this type. TODO: actually enforce perfect hashing
Source§

fn arm(&self) -> Option<&'static str>

If the named type is an enum, this returns the name of the arm of the value self.
Source§

fn typeid() -> TypeId

The TypeId for this type. TypeIds are unique only within a binary, and should not be used for global identification.
Source§

fn port() -> u64

The globally unique port for this type. Typed ports are in the range of 1<<63..1<<64-1.
Source§

unsafe fn arm_unchecked(self_: *const ()) -> Option<&'static str>

An unsafe version of ‘arm’, accepting a pointer to the value, for use in type-erased settings.
Source§

impl Serialize for WorkerMessage

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Unbind for WorkerMessage

Source§

fn unbind(&self, bindings: &mut Bindings) -> Result<()>

Extract parameters from itself and store them in bindings.
Source§

impl RemoteHandles<WorkerMessage> for WorkerActor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Checkpointable for T
where T: RemoteMessage + Clone,

Source§

type State = T

The type of the state that is saved. The state can be serialized and deserialized from persistent storage.
Source§

fn save<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<<T as Checkpointable>::State, CheckpointError>> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

Saves the current state.
Source§

fn load<'async_trait>( state: <T as Checkpointable>::State, ) -> Pin<Box<dyn Future<Output = Result<T, CheckpointError>> + Send + 'async_trait>>
where T: 'async_trait,

Loads the a state to restore the instance.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<A, M> Handler<IndexedErasedUnbound<M>> for A
where A: Handler<M>, M: Castable,

Source§

fn handle<'life0, 'life1, 'async_trait>( &'life0 mut self, cx: &'life1 Context<'_, A>, msg: IndexedErasedUnbound<M>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, A: 'async_trait,

Handle the next M-typed message.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> Castable for T
where T: RemoteMessage + Bind + Unbind,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<M> Message for M
where M: Debug + Send + Sync + 'static,

Source§

impl<M> RemoteMessage for M

§

impl<T> Ungil for T
where T: Send,