pub struct SafetyRequest {
pub source_node: Option<NodeId>,
pub request_id: Option<u128>,
pub content: Option<String>,
pub content_size: usize,
pub estimated_tokens: u32,
pub metadata: HashMap<String, String>,
}Expand description
Request context for safety checks
Fields§
§source_node: Option<NodeId>Source node
request_id: Option<u128>Request ID
content: Option<String>Content to check (optional)
content_size: usizeContent size in bytes
estimated_tokens: u32Estimated tokens
metadata: HashMap<String, String>Custom metadata
Implementations§
Source§impl SafetyRequest
impl SafetyRequest
Sourcepub fn with_source(self, node: NodeId) -> Self
pub fn with_source(self, node: NodeId) -> Self
Set source node
Sourcepub fn with_request_id(self, id: u128) -> Self
pub fn with_request_id(self, id: u128) -> Self
Set request ID
Sourcepub fn with_content(self, content: impl Into<String>) -> Self
pub fn with_content(self, content: impl Into<String>) -> Self
Set content
Sourcepub fn with_content_size(self, size: usize) -> Self
pub fn with_content_size(self, size: usize) -> Self
Set content size only (without content)
Sourcepub fn with_tokens(self, tokens: u32) -> Self
pub fn with_tokens(self, tokens: u32) -> Self
Set estimated tokens
Trait Implementations§
Source§impl Clone for SafetyRequest
impl Clone for SafetyRequest
Source§fn clone(&self) -> SafetyRequest
fn clone(&self) -> SafetyRequest
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 moreSource§impl Debug for SafetyRequest
impl Debug for SafetyRequest
Source§impl Default for SafetyRequest
impl Default for SafetyRequest
Source§fn default() -> SafetyRequest
fn default() -> SafetyRequest
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SafetyRequest
impl RefUnwindSafe for SafetyRequest
impl Send for SafetyRequest
impl Sync for SafetyRequest
impl Unpin for SafetyRequest
impl UnsafeUnpin for SafetyRequest
impl UnwindSafe for SafetyRequest
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