pub struct ResponseValidator;
Expand description
Validate UAttributes
with type UMessageType::Response
Implementations§
Source§impl ResponseValidator
impl ResponseValidator
Sourcepub fn validate_reqid(
&self,
attributes: &UAttributes,
) -> Result<(), UAttributesError>
pub fn validate_reqid( &self, attributes: &UAttributes, ) -> Result<(), UAttributesError>
Verifies that the attributes contain a valid request ID.
§Errors
Returns an error if UAttributes::reqid
is empty or contains a value which is not
a valid uProtocol UUID.
Sourcepub fn validate_commstatus(
&self,
attributes: &UAttributes,
) -> Result<(), UAttributesError>
pub fn validate_commstatus( &self, attributes: &UAttributes, ) -> Result<(), UAttributesError>
Verifies that a set of attributes contains a valid communication status.
§Errors
Returns an error if UAttributes::commstatus
does not contain a value that is a UCode
.
Trait Implementations§
Source§impl UAttributesValidator for ResponseValidator
impl UAttributesValidator for ResponseValidator
Source§fn validate(&self, attributes: &UAttributes) -> Result<(), UAttributesError>
fn validate(&self, attributes: &UAttributes) -> Result<(), UAttributesError>
Checks if a given set of attributes complies with the rules specified for RPC response messages.
§Errors
Returns an error if any of the following checks fail for the given attributes:
Source§fn validate_source(
&self,
attributes: &UAttributes,
) -> Result<(), UAttributesError>
fn validate_source( &self, attributes: &UAttributes, ) -> Result<(), UAttributesError>
Verifies that attributes for a message representing an RPC response indicate the method that has been invoked.
§Errors
Returns an error if the UAttributes::source
property does not contain a URI representing a method according to
UUri::verify_rpc_method
.
Source§fn validate_sink(
&self,
attributes: &UAttributes,
) -> Result<(), UAttributesError>
fn validate_sink( &self, attributes: &UAttributes, ) -> Result<(), UAttributesError>
Verifies that attributes for a message representing an RPC response contain a valid reply-to-address.
§Errors
Returns an error if the UAttributes::sink
property does not contain a valid reply-to-address according to
UUri::verify_rpc_response
.