reactive_graph/client/instances/entities/args/
id_and_component.rs

1use crate::client::error::CommandError;
2use crate::client::error::CommandError::NotFound;
3use crate::client::types::components::args::type_id::ComponentTypeIdArgs;
4use clap::Args;
5use uuid::Uuid;
6
7/// Identifies a component of an entity instance.
8#[derive(Args, Debug, Clone)]
9pub(crate) struct IdAndComponentArgs {
10    /// The id of the reactive instance.
11    pub id: Uuid,
12
13    /// The component type of the reactive instance.
14    #[clap(flatten)]
15    pub component_ty: ComponentTypeIdArgs,
16}
17
18impl IdAndComponentArgs {
19    pub fn id_not_found(&self) -> CommandError {
20        NotFound(format!("The instance with the id {} was not found", &self.id))
21    }
22}