pub struct RegexAcceleratorCapability {
pub backend: &'static str,
pub accelerator_class: RegexAcceleratorClass,
pub supported: bool,
pub device_signature: &'static str,
pub rule_capacity: u32,
pub stream_mode: RegexAcceleratorStreamMode,
pub match_schema: RegexAcceleratorMatchSchema,
pub unsupported_reason: &'static str,
}Expand description
Backend capability for hardware or software regex acceleration.
Fields§
§backend: &'static strBackend id that owns this capability.
accelerator_class: RegexAcceleratorClassAccelerator class.
supported: boolTrue only when the backend can execute this accelerator class.
device_signature: &'static strDevice signature for supported accelerators.
rule_capacity: u32Maximum rule count accepted by the accelerator.
stream_mode: RegexAcceleratorStreamModeStream mode accepted by the accelerator.
match_schema: RegexAcceleratorMatchSchemaMatch schema emitted by the accelerator.
unsupported_reason: &'static strUnsupported reason for fail-closed capability records.
Implementations§
Source§impl RegexAcceleratorCapability
impl RegexAcceleratorCapability
Sourcepub const fn unsupported(
backend: &'static str,
accelerator_class: RegexAcceleratorClass,
unsupported_reason: &'static str,
) -> Self
pub const fn unsupported( backend: &'static str, accelerator_class: RegexAcceleratorClass, unsupported_reason: &'static str, ) -> Self
Construct a fail-closed unsupported capability record.
Sourcepub const fn supported(
backend: &'static str,
accelerator_class: RegexAcceleratorClass,
device_signature: &'static str,
rule_capacity: u32,
stream_mode: RegexAcceleratorStreamMode,
match_schema: RegexAcceleratorMatchSchema,
) -> Self
pub const fn supported( backend: &'static str, accelerator_class: RegexAcceleratorClass, device_signature: &'static str, rule_capacity: u32, stream_mode: RegexAcceleratorStreamMode, match_schema: RegexAcceleratorMatchSchema, ) -> Self
Construct a supported accelerator capability record.
Sourcepub fn require_supported(self) -> Result<Self, BackendError>
pub fn require_supported(self) -> Result<Self, BackendError>
Fail closed when a caller requires hardware regex acceleration.
§Errors
Returns BackendError::UnsupportedFeature when this backend does not
advertise the requested accelerator class.
Sourcepub const fn evidence(self, transfer_bytes: u64) -> RegexAcceleratorEvidence
pub const fn evidence(self, transfer_bytes: u64) -> RegexAcceleratorEvidence
Emit benchmark evidence for this regex accelerator capability.
Trait Implementations§
Source§impl Clone for RegexAcceleratorCapability
impl Clone for RegexAcceleratorCapability
Source§fn clone(&self) -> RegexAcceleratorCapability
fn clone(&self) -> RegexAcceleratorCapability
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RegexAcceleratorCapability
Source§impl Debug for RegexAcceleratorCapability
impl Debug for RegexAcceleratorCapability
impl Eq for RegexAcceleratorCapability
Source§impl PartialEq for RegexAcceleratorCapability
impl PartialEq for RegexAcceleratorCapability
Source§fn eq(&self, other: &RegexAcceleratorCapability) -> bool
fn eq(&self, other: &RegexAcceleratorCapability) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RegexAcceleratorCapability
Auto Trait Implementations§
impl Freeze for RegexAcceleratorCapability
impl RefUnwindSafe for RegexAcceleratorCapability
impl Send for RegexAcceleratorCapability
impl Sync for RegexAcceleratorCapability
impl Unpin for RegexAcceleratorCapability
impl UnsafeUnpin for RegexAcceleratorCapability
impl UnwindSafe for RegexAcceleratorCapability
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.