pub struct InterfaceDescriptor {
pub format: String,
pub documentation: Option<Documentation>,
pub types: Vec<TypeDeclaration>,
pub operations: Vec<OperationDeclaration>,
}Expand description
Transport-independent description of one interface.
Interface identity is supplied by interaction fields such as
FetchInterfaceResponse::interface, not embedded in the descriptor.
Fields§
§format: StringDescriptor format version understood by clients and hosts.
documentation: Option<Documentation>Optional interface documentation.
types: Vec<TypeDeclaration>Named declarations local to this descriptor.
operations: Vec<OperationDeclaration>Operations exposed by this interface.
Implementations§
Source§impl InterfaceDescriptor
impl InterfaceDescriptor
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validates declaration structure, named references, and absence of cycles.
Sourcepub fn validate_value(
&self,
type: &TypeExpr,
value: &Value,
) -> Result<(), ValidationError>
pub fn validate_value( &self, type: &TypeExpr, value: &Value, ) -> Result<(), ValidationError>
Validates a raw value against a type expression in this descriptor.
Sourcepub fn validate_arguments(
&self,
operation: &str,
arguments: &BTreeMap<String, Value>,
) -> Result<(), ValidationError>
pub fn validate_arguments( &self, operation: &str, arguments: &BTreeMap<String, Value>, ) -> Result<(), ValidationError>
Validates named arguments for one declared operation.
Sourcepub fn validate_result(
&self,
operation: &str,
result: &Value,
) -> Result<(), ValidationError>
pub fn validate_result( &self, operation: &str, result: &Value, ) -> Result<(), ValidationError>
Validates one operation result against its return declaration.
Sourcepub fn validate_call(
&self,
request: &CallOperationRequest,
) -> Result<(), ValidationError>
pub fn validate_call( &self, request: &CallOperationRequest, ) -> Result<(), ValidationError>
Validates the path, operation, and arguments in a call request.
Trait Implementations§
Source§impl Clone for InterfaceDescriptor
impl Clone for InterfaceDescriptor
Source§impl Debug for InterfaceDescriptor
impl Debug for InterfaceDescriptor
impl Eq for InterfaceDescriptor
Source§impl PartialEq for InterfaceDescriptor
impl PartialEq for InterfaceDescriptor
impl StructuralPartialEq for InterfaceDescriptor
Auto Trait Implementations§
impl Freeze for InterfaceDescriptor
impl RefUnwindSafe for InterfaceDescriptor
impl Send for InterfaceDescriptor
impl Sync for InterfaceDescriptor
impl Unpin for InterfaceDescriptor
impl UnsafeUnpin for InterfaceDescriptor
impl UnwindSafe for InterfaceDescriptor
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