pub struct SemanticExtractionLimits {
pub max_entities: usize,
pub max_attribute_keys: usize,
pub max_values_per_attribute: usize,
pub max_value_bytes: usize,
pub max_source_evidence_ids: usize,
pub max_url_bytes: usize,
}Expand description
Safety limits for bounded semantic entity extraction.
Fields§
§max_entities: usizeMaximum number of entities extracted from a single evidence batch.
max_attribute_keys: usizeMaximum number of attribute keys per entity.
max_values_per_attribute: usizeMaximum number of values per attribute.
max_value_bytes: usizeMaximum length in bytes for any single attribute value.
max_source_evidence_ids: usizeMaximum supporting evidence IDs recorded per entity.
max_url_bytes: usizeMaximum URL length in bytes.
Implementations§
Source§impl SemanticExtractionLimits
impl SemanticExtractionLimits
Sourcepub const HARD_MAX_ENTITIES: usize = 10_000
pub const HARD_MAX_ENTITIES: usize = 10_000
Hard ceiling on entity count.
Sourcepub const HARD_MAX_ATTRIBUTE_KEYS: usize = 200
pub const HARD_MAX_ATTRIBUTE_KEYS: usize = 200
Hard ceiling on attribute keys per entity.
Sourcepub const HARD_MAX_VALUES_PER_ATTRIBUTE: usize = 500
pub const HARD_MAX_VALUES_PER_ATTRIBUTE: usize = 500
Hard ceiling on values per attribute key.
Sourcepub const HARD_MAX_VALUE_BYTES: usize = 65_536
pub const HARD_MAX_VALUE_BYTES: usize = 65_536
Hard ceiling on value bytes.
Sourcepub const HARD_MAX_SOURCE_EVIDENCE_IDS: usize = 10_000
pub const HARD_MAX_SOURCE_EVIDENCE_IDS: usize = 10_000
Hard ceiling on source evidence IDs recorded per entity.
Sourcepub const HARD_MAX_URL_BYTES: usize = 8_192
pub const HARD_MAX_URL_BYTES: usize = 8_192
Hard ceiling on URL length in bytes.
Sourcepub fn new(
max_entities: usize,
max_attribute_keys: usize,
max_values_per_attribute: usize,
max_value_bytes: usize,
max_source_evidence_ids: usize,
max_url_bytes: usize,
) -> Result<Self, LimitsError>
pub fn new( max_entities: usize, max_attribute_keys: usize, max_values_per_attribute: usize, max_value_bytes: usize, max_source_evidence_ids: usize, max_url_bytes: usize, ) -> Result<Self, LimitsError>
Validates and constructs new extraction limits bounded by hard ceilings.
Sourcepub fn validate(&self) -> Result<(), LimitsError>
pub fn validate(&self) -> Result<(), LimitsError>
Revalidates every configured dimension against its compiled ceiling.
Sourcepub const fn max_entities(&self) -> usize
pub const fn max_entities(&self) -> usize
Returns the maximum number of retained entities.
Sourcepub const fn max_attribute_keys(&self) -> usize
pub const fn max_attribute_keys(&self) -> usize
Returns the maximum number of attribute keys on one entity.
Sourcepub const fn max_values_per_attribute(&self) -> usize
pub const fn max_values_per_attribute(&self) -> usize
Returns the maximum number of values retained for one attribute.
Sourcepub const fn max_value_bytes(&self) -> usize
pub const fn max_value_bytes(&self) -> usize
Returns the maximum byte length of one retained attribute value.
Sourcepub const fn max_source_evidence_ids(&self) -> usize
pub const fn max_source_evidence_ids(&self) -> usize
Returns the maximum number of source evidence identities per entity.
Sourcepub const fn max_url_bytes(&self) -> usize
pub const fn max_url_bytes(&self) -> usize
Returns the maximum accepted canonical URL byte length.
Trait Implementations§
Source§impl Clone for SemanticExtractionLimits
impl Clone for SemanticExtractionLimits
Source§fn clone(&self) -> SemanticExtractionLimits
fn clone(&self) -> SemanticExtractionLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SemanticExtractionLimits
impl Debug for SemanticExtractionLimits
Source§impl Default for SemanticExtractionLimits
impl Default for SemanticExtractionLimits
Source§impl<'de> Deserialize<'de> for SemanticExtractionLimits
impl<'de> Deserialize<'de> for SemanticExtractionLimits
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>,
impl Eq for SemanticExtractionLimits
Source§impl PartialEq for SemanticExtractionLimits
impl PartialEq for SemanticExtractionLimits
Source§impl Serialize for SemanticExtractionLimits
impl Serialize for SemanticExtractionLimits
impl StructuralPartialEq for SemanticExtractionLimits
Auto Trait Implementations§
impl Freeze for SemanticExtractionLimits
impl RefUnwindSafe for SemanticExtractionLimits
impl Send for SemanticExtractionLimits
impl Sync for SemanticExtractionLimits
impl Unpin for SemanticExtractionLimits
impl UnsafeUnpin for SemanticExtractionLimits
impl UnwindSafe for SemanticExtractionLimits
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.