pub enum ExplorerToOrchestrator<T> {
Show 13 variants
StartExplorerAIResult {
explorer_id: ID,
},
KillExplorerResult {
explorer_id: ID,
},
ResetExplorerAIResult {
explorer_id: ID,
},
StopExplorerAIResult {
explorer_id: ID,
},
MovedToPlanetResult {
explorer_id: ID,
planet_id: ID,
},
CurrentPlanetResult {
explorer_id: ID,
planet_id: ID,
},
SupportedResourceResult {
explorer_id: ID,
supported_resources: HashSet<BasicResourceType>,
},
SupportedCombinationResult {
explorer_id: ID,
combination_list: HashSet<ComplexResourceType>,
},
GenerateResourceResponse {
explorer_id: ID,
generated: Result<(), String>,
},
CombineResourceResponse {
explorer_id: ID,
generated: Result<(), String>,
},
BagContentResponse {
explorer_id: ID,
bag_content: T,
},
NeighborsRequest {
explorer_id: ID,
current_planet_id: ID,
},
TravelToPlanetRequest {
explorer_id: ID,
current_planet_id: ID,
dst_planet_id: ID,
},
}Expand description
This enum describes all possible messages from an Explorer to the Orchestrator
Variants§
StartExplorerAIResult
This variant is used to acknowledge the starting of the Explorer AI
Response To: OrchestratorToExplorer::StartExplorerAI
KillExplorerResult
This variant is used to acknowledge the killing of an Explorer
Response To: OrchestratorToExplorer::KillExplorer
ResetExplorerAIResult
This variant is used to acknowledge the reset of the Explorer AI
Response To: OrchestratorToExplorer::ResetExplorerAI
StopExplorerAIResult
This variant is used to acknowledge the stopping of the Explorer AI
Response To: OrchestratorToExplorer::StopExplorerAI
MovedToPlanetResult
This variant is used to acknowledge the transfer of an Explorer to a new Planet
Response To: OrchestratorToExplorer::MoveToPlanet
Fields
CurrentPlanetResult
This variant is used to send the ID of the current planet on which the Explorer is located
Response To: OrchestratorToExplorer::CurrentPlanetRequest
Fields
SupportedResourceResult
This variant is used to send the list of the available BasicResourceType in the Explorer’s current planet
Response To: OrchestratorToExplorer::SupportedResourceRequest
Fields
supported_resources: HashSet<BasicResourceType>The Set of BasicResourceType available in the Explorer’s current planet
SupportedCombinationResult
This variant is used to send the list of the available ComplexResourceType in the Explorer’s current planet
Response To: OrchestratorToExplorer::SupportedCombinationRequest
Fields
combination_list: HashSet<ComplexResourceType>The Set of ComplexResourceType available in the Explorer’s current planet
GenerateResourceResponse
This variant is used to send the generated Basic Resource asked by the Orchestrator
Response To: OrchestratorToExplorer::GenerateResourceRequest
Fields
CombineResourceResponse
This variant is used to send the generated ComplexResource asked by the Orchestrator
Response To: OrchestratorToExplorer::CombineResourceRequest
Fields
BagContentResponse
This message is for passing around the bag content and has been implemented with a generic type to let the group the freedom to implement the methods on it
Response To: OrchestratorToExplorer::BagContentRequest
Fields
bag_content: TThe generic bag_content type
NeighborsRequest
This variant asks the Orchestrator for the list of neighbors Planets to travel to
Expected Response: OrchestratorToExplorer::NeighborsResponse
Use Case: Knowing reachable planets from current planet
Fields
TravelToPlanetRequest
This variant asks the Orchestrator to be sent to the specified Planet
Expected Response: OrchestratorToExplorer::MoveToPlanet
Use Case: Autonomously asking to travel to a planet
Implementations§
Source§impl<T> ExplorerToOrchestrator<T>
impl<T> ExplorerToOrchestrator<T>
Sourcepub fn is_start_explorer_ai_result(&self) -> bool
pub fn is_start_explorer_ai_result(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::StartExplorerAIResult, otherwise false
Sourcepub fn as_start_explorer_ai_result_mut(&mut self) -> Option<&mut ID>
pub fn as_start_explorer_ai_result_mut(&mut self) -> Option<&mut ID>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::StartExplorerAIResult, otherwise None
Sourcepub fn as_start_explorer_ai_result(&self) -> Option<&ID>
pub fn as_start_explorer_ai_result(&self) -> Option<&ID>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::StartExplorerAIResult, otherwise None
Sourcepub fn into_start_explorer_ai_result(self) -> Result<ID, Self>
pub fn into_start_explorer_ai_result(self) -> Result<ID, Self>
Returns the inner fields if this is a ExplorerToOrchestrator::StartExplorerAIResult, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_kill_explorer_result(&self) -> bool
pub fn is_kill_explorer_result(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::KillExplorerResult, otherwise false
Sourcepub fn as_kill_explorer_result_mut(&mut self) -> Option<&mut ID>
pub fn as_kill_explorer_result_mut(&mut self) -> Option<&mut ID>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::KillExplorerResult, otherwise None
Sourcepub fn as_kill_explorer_result(&self) -> Option<&ID>
pub fn as_kill_explorer_result(&self) -> Option<&ID>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::KillExplorerResult, otherwise None
Sourcepub fn into_kill_explorer_result(self) -> Result<ID, Self>
pub fn into_kill_explorer_result(self) -> Result<ID, Self>
Returns the inner fields if this is a ExplorerToOrchestrator::KillExplorerResult, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_reset_explorer_ai_result(&self) -> bool
pub fn is_reset_explorer_ai_result(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::ResetExplorerAIResult, otherwise false
Sourcepub fn as_reset_explorer_ai_result_mut(&mut self) -> Option<&mut ID>
pub fn as_reset_explorer_ai_result_mut(&mut self) -> Option<&mut ID>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::ResetExplorerAIResult, otherwise None
Sourcepub fn as_reset_explorer_ai_result(&self) -> Option<&ID>
pub fn as_reset_explorer_ai_result(&self) -> Option<&ID>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::ResetExplorerAIResult, otherwise None
Sourcepub fn into_reset_explorer_ai_result(self) -> Result<ID, Self>
pub fn into_reset_explorer_ai_result(self) -> Result<ID, Self>
Returns the inner fields if this is a ExplorerToOrchestrator::ResetExplorerAIResult, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_stop_explorer_ai_result(&self) -> bool
pub fn is_stop_explorer_ai_result(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::StopExplorerAIResult, otherwise false
Sourcepub fn as_stop_explorer_ai_result_mut(&mut self) -> Option<&mut ID>
pub fn as_stop_explorer_ai_result_mut(&mut self) -> Option<&mut ID>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::StopExplorerAIResult, otherwise None
Sourcepub fn as_stop_explorer_ai_result(&self) -> Option<&ID>
pub fn as_stop_explorer_ai_result(&self) -> Option<&ID>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::StopExplorerAIResult, otherwise None
Sourcepub fn into_stop_explorer_ai_result(self) -> Result<ID, Self>
pub fn into_stop_explorer_ai_result(self) -> Result<ID, Self>
Returns the inner fields if this is a ExplorerToOrchestrator::StopExplorerAIResult, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_moved_to_planet_result(&self) -> bool
pub fn is_moved_to_planet_result(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::MovedToPlanetResult, otherwise false
Sourcepub fn as_moved_to_planet_result_mut(&mut self) -> Option<(&mut ID, &mut ID)>
pub fn as_moved_to_planet_result_mut(&mut self) -> Option<(&mut ID, &mut ID)>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::MovedToPlanetResult, otherwise None
Sourcepub fn as_moved_to_planet_result(&self) -> Option<(&ID, &ID)>
pub fn as_moved_to_planet_result(&self) -> Option<(&ID, &ID)>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::MovedToPlanetResult, otherwise None
Sourcepub fn into_moved_to_planet_result(self) -> Result<(ID, ID), Self>
pub fn into_moved_to_planet_result(self) -> Result<(ID, ID), Self>
Returns the inner fields if this is a ExplorerToOrchestrator::MovedToPlanetResult, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_current_planet_result(&self) -> bool
pub fn is_current_planet_result(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::CurrentPlanetResult, otherwise false
Sourcepub fn as_current_planet_result_mut(&mut self) -> Option<(&mut ID, &mut ID)>
pub fn as_current_planet_result_mut(&mut self) -> Option<(&mut ID, &mut ID)>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::CurrentPlanetResult, otherwise None
Sourcepub fn as_current_planet_result(&self) -> Option<(&ID, &ID)>
pub fn as_current_planet_result(&self) -> Option<(&ID, &ID)>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::CurrentPlanetResult, otherwise None
Sourcepub fn into_current_planet_result(self) -> Result<(ID, ID), Self>
pub fn into_current_planet_result(self) -> Result<(ID, ID), Self>
Returns the inner fields if this is a ExplorerToOrchestrator::CurrentPlanetResult, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_supported_resource_result(&self) -> bool
pub fn is_supported_resource_result(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::SupportedResourceResult, otherwise false
Sourcepub fn as_supported_resource_result_mut(
&mut self,
) -> Option<(&mut ID, &mut HashSet<BasicResourceType>)>
pub fn as_supported_resource_result_mut( &mut self, ) -> Option<(&mut ID, &mut HashSet<BasicResourceType>)>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::SupportedResourceResult, otherwise None
Sourcepub fn as_supported_resource_result(
&self,
) -> Option<(&ID, &HashSet<BasicResourceType>)>
pub fn as_supported_resource_result( &self, ) -> Option<(&ID, &HashSet<BasicResourceType>)>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::SupportedResourceResult, otherwise None
Sourcepub fn into_supported_resource_result(
self,
) -> Result<(ID, HashSet<BasicResourceType>), Self>
pub fn into_supported_resource_result( self, ) -> Result<(ID, HashSet<BasicResourceType>), Self>
Returns the inner fields if this is a ExplorerToOrchestrator::SupportedResourceResult, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_supported_combination_result(&self) -> bool
pub fn is_supported_combination_result(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::SupportedCombinationResult, otherwise false
Sourcepub fn as_supported_combination_result_mut(
&mut self,
) -> Option<(&mut ID, &mut HashSet<ComplexResourceType>)>
pub fn as_supported_combination_result_mut( &mut self, ) -> Option<(&mut ID, &mut HashSet<ComplexResourceType>)>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::SupportedCombinationResult, otherwise None
Sourcepub fn as_supported_combination_result(
&self,
) -> Option<(&ID, &HashSet<ComplexResourceType>)>
pub fn as_supported_combination_result( &self, ) -> Option<(&ID, &HashSet<ComplexResourceType>)>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::SupportedCombinationResult, otherwise None
Sourcepub fn into_supported_combination_result(
self,
) -> Result<(ID, HashSet<ComplexResourceType>), Self>
pub fn into_supported_combination_result( self, ) -> Result<(ID, HashSet<ComplexResourceType>), Self>
Returns the inner fields if this is a ExplorerToOrchestrator::SupportedCombinationResult, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_generate_resource_response(&self) -> bool
pub fn is_generate_resource_response(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::GenerateResourceResponse, otherwise false
Sourcepub fn as_generate_resource_response_mut(
&mut self,
) -> Option<(&mut ID, &mut Result<(), String>)>
pub fn as_generate_resource_response_mut( &mut self, ) -> Option<(&mut ID, &mut Result<(), String>)>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::GenerateResourceResponse, otherwise None
Sourcepub fn as_generate_resource_response(
&self,
) -> Option<(&ID, &Result<(), String>)>
pub fn as_generate_resource_response( &self, ) -> Option<(&ID, &Result<(), String>)>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::GenerateResourceResponse, otherwise None
Sourcepub fn into_generate_resource_response(
self,
) -> Result<(ID, Result<(), String>), Self>
pub fn into_generate_resource_response( self, ) -> Result<(ID, Result<(), String>), Self>
Returns the inner fields if this is a ExplorerToOrchestrator::GenerateResourceResponse, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_combine_resource_response(&self) -> bool
pub fn is_combine_resource_response(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::CombineResourceResponse, otherwise false
Sourcepub fn as_combine_resource_response_mut(
&mut self,
) -> Option<(&mut ID, &mut Result<(), String>)>
pub fn as_combine_resource_response_mut( &mut self, ) -> Option<(&mut ID, &mut Result<(), String>)>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::CombineResourceResponse, otherwise None
Sourcepub fn as_combine_resource_response(&self) -> Option<(&ID, &Result<(), String>)>
pub fn as_combine_resource_response(&self) -> Option<(&ID, &Result<(), String>)>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::CombineResourceResponse, otherwise None
Sourcepub fn into_combine_resource_response(
self,
) -> Result<(ID, Result<(), String>), Self>
pub fn into_combine_resource_response( self, ) -> Result<(ID, Result<(), String>), Self>
Returns the inner fields if this is a ExplorerToOrchestrator::CombineResourceResponse, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_bag_content_response(&self) -> bool
pub fn is_bag_content_response(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::BagContentResponse, otherwise false
Sourcepub fn as_bag_content_response_mut(&mut self) -> Option<(&mut ID, &mut T)>
pub fn as_bag_content_response_mut(&mut self) -> Option<(&mut ID, &mut T)>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::BagContentResponse, otherwise None
Sourcepub fn as_bag_content_response(&self) -> Option<(&ID, &T)>
pub fn as_bag_content_response(&self) -> Option<(&ID, &T)>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::BagContentResponse, otherwise None
Sourcepub fn into_bag_content_response(self) -> Result<(ID, T), Self>
pub fn into_bag_content_response(self) -> Result<(ID, T), Self>
Returns the inner fields if this is a ExplorerToOrchestrator::BagContentResponse, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_neighbors_request(&self) -> bool
pub fn is_neighbors_request(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::NeighborsRequest, otherwise false
Sourcepub fn as_neighbors_request_mut(&mut self) -> Option<(&mut ID, &mut ID)>
pub fn as_neighbors_request_mut(&mut self) -> Option<(&mut ID, &mut ID)>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::NeighborsRequest, otherwise None
Sourcepub fn as_neighbors_request(&self) -> Option<(&ID, &ID)>
pub fn as_neighbors_request(&self) -> Option<(&ID, &ID)>
Optionally returns references to the inner fields if this is a ExplorerToOrchestrator::NeighborsRequest, otherwise None
Sourcepub fn into_neighbors_request(self) -> Result<(ID, ID), Self>
pub fn into_neighbors_request(self) -> Result<(ID, ID), Self>
Returns the inner fields if this is a ExplorerToOrchestrator::NeighborsRequest, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_travel_to_planet_request(&self) -> bool
pub fn is_travel_to_planet_request(&self) -> bool
Returns true if this is a ExplorerToOrchestrator::TravelToPlanetRequest, otherwise false
Sourcepub fn as_travel_to_planet_request_mut(
&mut self,
) -> Option<(&mut ID, &mut ID, &mut ID)>
pub fn as_travel_to_planet_request_mut( &mut self, ) -> Option<(&mut ID, &mut ID, &mut ID)>
Optionally returns mutable references to the inner fields if this is a ExplorerToOrchestrator::TravelToPlanetRequest, otherwise None
Source§impl<T> ExplorerToOrchestrator<T>
impl<T> ExplorerToOrchestrator<T>
Sourcepub fn explorer_id(&self) -> ID
pub fn explorer_id(&self) -> ID
Helper method to extract the explorer_id field from any message variant
without needing to match a specific one.