pub struct SseRedactor { /* private fields */ }Expand description
Implementations§
Source§impl SseRedactor
impl SseRedactor
Sourcepub fn new(provider: &Provider) -> Self
pub fn new(provider: &Provider) -> Self
A rewriter for responses to a request sent to provider.
Sourcepub fn for_responses_api() -> Self
pub fn for_responses_api() -> Self
A rewriter for streamed OpenAI Responses API (/v1/responses)
responses.
Sourcepub fn push(&mut self, redactor: &PiiRedactor, bytes: &[u8]) -> Vec<u8> ⓘ
pub fn push(&mut self, redactor: &PiiRedactor, bytes: &[u8]) -> Vec<u8> ⓘ
Add upstream bytes; returns the bytes to send to the client now.
Sourcepub fn finish(&mut self, redactor: &PiiRedactor) -> Vec<u8> ⓘ
pub fn finish(&mut self, redactor: &PiiRedactor) -> Vec<u8> ⓘ
Upstream ended: release anything still held back, then any trailing partial event as-is.
Sourcepub fn redactions(&self) -> usize
pub fn redactions(&self) -> usize
Total redactions applied so far.
Sourcepub fn entity_types(&self) -> &[String]
pub fn entity_types(&self) -> &[String]
Distinct entity types redacted so far (e.g. "Email").
Auto Trait Implementations§
impl Forget for SseRedactor
impl Freeze for SseRedactorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const LeafNode<u64, StreamingPiiRedactor> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(u64, StreamingPiiRedactor)>>: Freeze,
PhantomData<String>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
*const LeafNode<u64, (Value, Value)> is !null: Freeze,
PhantomData<Box<(u64, (Value, Value))>>: Freeze,
impl Move for SseRedactor
impl RefUnwindSafe for SseRedactor
impl Send for SseRedactorwhere
RawVecInner: Send,
NodeRef<Owned, u64, StreamingPiiRedactor, LeafOrInternal>: Send,
BoxRaw<(u64, StreamingPiiRedactor)>: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
NodeRef<Owned, u64, (Value, Value), LeafOrInternal>: Send,
BoxRaw<(u64, (Value, Value))>: Send,
impl Sync for SseRedactorwhere
RawVecInner: Sync,
NodeRef<Owned, u64, StreamingPiiRedactor, LeafOrInternal>: Sync,
BoxRaw<(u64, StreamingPiiRedactor)>: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
NodeRef<Owned, u64, (Value, Value), LeafOrInternal>: Sync,
BoxRaw<(u64, (Value, Value))>: Sync,
impl Unpin for SseRedactor
impl UnsafeUnpin for SseRedactorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<u64, StreamingPiiRedactor> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(u64, StreamingPiiRedactor)>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
*const LeafNode<u64, (Value, Value)> is !null: UnsafeUnpin,
PhantomData<Box<(u64, (Value, Value))>>: UnsafeUnpin,
impl UnwindSafe for SseRedactorwhere
RawVecInner: UnwindSafe,
BTreeMap<u64, StreamingPiiRedactor>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BTreeMap<u64, (Value, Value)>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request