pub enum StringDomain {
Any,
Regex {
pattern: RegexPattern,
},
}Expand description
String domain: accept-all or regex-matched.
Variants§
Any
Any UTF-8 string is a member.
Regex
Members are the strings matching this regex.
Fields
§
pattern: RegexPatternThe compiled pattern.
Implementations§
Source§impl StringDomain
impl StringDomain
Sourcepub fn regex(source: impl Into<String>) -> Result<Self>
pub fn regex(source: impl Into<String>) -> Result<Self>
Construct a regex domain from a source pattern.
Sourcepub fn contains_native(&self, value: &str) -> bool
pub fn contains_native(&self, value: &str) -> bool
Membership test on the native payload.
Sourcepub const fn cardinality(&self) -> Cardinality
pub const fn cardinality(&self) -> Cardinality
String domains are Unbounded regardless of shape.
Sourcepub fn boundaries_native(&self) -> Vec<String>
pub fn boundaries_native(&self) -> Vec<String>
Conservative boundary set. Any returns [""]; Regex also
returns [""] as a placeholder until regex-sampling lands —
see module docs.
Trait Implementations§
Source§impl Clone for StringDomain
impl Clone for StringDomain
Source§fn clone(&self) -> StringDomain
fn clone(&self) -> StringDomain
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StringDomain
impl Debug for StringDomain
Source§impl<'de> Deserialize<'de> for StringDomain
impl<'de> Deserialize<'de> for StringDomain
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for StringDomain
impl Hash for StringDomain
Source§impl PartialEq for StringDomain
impl PartialEq for StringDomain
Source§impl Serialize for StringDomain
impl Serialize for StringDomain
impl Eq for StringDomain
impl StructuralPartialEq for StringDomain
Auto Trait Implementations§
impl Freeze for StringDomain
impl RefUnwindSafe for StringDomain
impl Send for StringDomain
impl Sync for StringDomain
impl Unpin for StringDomain
impl UnsafeUnpin for StringDomain
impl UnwindSafe for StringDomain
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.