pub struct DescriptorValidator { /* private fields */ }Expand description
Validator for message descriptors.
Ensures that descriptors only reference regions with policies that are safe for zero-copy message passing (Immutable or AppendOnly).
Implementations§
Source§impl DescriptorValidator
impl DescriptorValidator
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Create a new validator with default settings (Immutable and AppendOnly allowed).
Sourcepub const fn immutable_only() -> Self
pub const fn immutable_only() -> Self
Create a validator that only allows Immutable regions.
Sourcepub fn validate_policy(&self, policy: &RegionPolicy) -> Result<()>
pub fn validate_policy(&self, policy: &RegionPolicy) -> Result<()>
Validate that a region policy is safe for descriptor-based messaging.
§Errors
Returns InvalidDescriptorRegion if the policy doesn’t allow descriptors.
Sourcepub fn validate_bounds(
&self,
descriptor: &MessageDescriptor,
region_size: usize,
) -> Result<()>
pub fn validate_bounds( &self, descriptor: &MessageDescriptor, region_size: usize, ) -> Result<()>
Sourcepub fn validate(
&self,
descriptor: &MessageDescriptor,
policy: &RegionPolicy,
region_size: usize,
) -> Result<()>
pub fn validate( &self, descriptor: &MessageDescriptor, policy: &RegionPolicy, region_size: usize, ) -> Result<()>
Full validation of a descriptor.
Checks that:
- The descriptor is valid (non-null region, non-zero length)
- The region policy allows descriptors
- The offset + length is within region bounds
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DescriptorValidator
impl RefUnwindSafe for DescriptorValidator
impl Send for DescriptorValidator
impl Sync for DescriptorValidator
impl Unpin for DescriptorValidator
impl UnsafeUnpin for DescriptorValidator
impl UnwindSafe for DescriptorValidator
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