pub struct Operation {
pub id: String,
pub name: String,
pub description: Option<String>,
pub category: OperationCategory,
pub is_read_only: bool,
pub risk_level: OperationRiskLevel,
pub tags: Vec<String>,
pub details: OperationDetails,
}Expand description
Normalized operation model that works across all schema formats.
Fields§
§id: StringUnique identifier for this operation.
- OpenAPI: operationId or “{method} {path}”
- GraphQL: “{Type}.{field}” (e.g., “Query.users”, “Mutation.createUser”)
- SQL: “{action}_{table}” (e.g., “select_users”, “insert_orders”)
name: StringHuman-readable name.
description: Option<String>Description of what the operation does.
category: OperationCategoryOperation category.
is_read_only: boolWhether this is a read-only operation.
risk_level: OperationRiskLevelRisk level for UI hints.
Tags/categories for grouping.
details: OperationDetailsFormat-specific details.
Implementations§
Source§impl Operation
impl Operation
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
category: OperationCategory,
) -> Self
pub fn new( id: impl Into<String>, name: impl Into<String>, category: OperationCategory, ) -> Self
Create a new operation with minimal required fields.
Sourcepub fn matches_pattern(&self, pattern: &str) -> bool
pub fn matches_pattern(&self, pattern: &str) -> bool
Check if this operation matches a pattern. Patterns support glob-style wildcards: * (any characters)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Operation
impl<'de> Deserialize<'de> for Operation
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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
Mutably borrows from an owned value. Read more