pub struct PublishValidator;
Expand description
Validates attributes describing a Publish message.
Trait Implementations§
Source§impl UAttributesValidator for PublishValidator
impl UAttributesValidator for PublishValidator
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 publish 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 publish message contain a valid source URI.
§Errors
Returns an error
- if the attributes do not contain a source URI, or
- if the source URI contains any wildcards, or
- if the source URI has a resource ID of 0.
Source§fn validate_sink(
&self,
attributes: &UAttributes,
) -> Result<(), UAttributesError>
fn validate_sink( &self, attributes: &UAttributes, ) -> Result<(), UAttributesError>
Verifies that attributes for a publish message do not contain a sink URI.
§Errors
If the UAttributes::sink
property contains any URI, an error is returned.
Source§fn message_type(&self) -> UMessageType
fn message_type(&self) -> UMessageType
Returns the type of message that this validator can be used with.
Source§fn validate_type(
&self,
attributes: &UAttributes,
) -> Result<(), UAttributesError>
fn validate_type( &self, attributes: &UAttributes, ) -> Result<(), UAttributesError>
Verifies that this validator is appropriate for a set of attributes. Read more
Source§fn validate_id(&self, attributes: &UAttributes) -> Result<(), UAttributesError>
fn validate_id(&self, attributes: &UAttributes) -> Result<(), UAttributesError>
Verifies that a set of attributes contains a valid message ID. Read more
Auto Trait Implementations§
impl Freeze for PublishValidator
impl RefUnwindSafe for PublishValidator
impl Send for PublishValidator
impl Sync for PublishValidator
impl Unpin for PublishValidator
impl UnwindSafe for PublishValidator
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