pub struct Context { /* private fields */ }Expand description
Immutable revision handle; cloning a handle does not create a fork or retention edge.
Implementations§
Source§impl Context
impl Context
Sourcepub const fn id(&self) -> [u8; 32]
pub const fn id(&self) -> [u8; 32]
Portable revision identity for later authenticated attachment.
Sourcepub async fn inspect(&self) -> Result<ContextView, Error>
pub async fn inspect(&self) -> Result<ContextView, Error>
Read exact retained content and its pinned logical execution identity.
§Errors
Returns service rejection or malformed response without fabricating content.
Sourcepub fn fork(&self) -> ContextMutation
pub fn fork(&self) -> ContextMutation
Prepare an independently retained fork. Sending twice reconciles that fork.
Sourcepub fn edit(&self, edits: Vec<Edit>) -> ContextMutation
pub fn edit(&self, edits: Vec<Edit>) -> ContextMutation
Prepare exact atomic item edits, leaving this revision unchanged.
Sourcepub fn append(&self, text: impl Into<String>) -> ContextMutation
pub fn append(&self, text: impl Into<String>) -> ContextMutation
Prepare one exact user-message append.
Sourcepub fn truncate(&self, through: Option<[u8; 16]>) -> ContextMutation
pub fn truncate(&self, through: Option<[u8; 16]>) -> ContextMutation
Retain exactly the selected prefix; None explicitly means an empty prefix.
Sourcepub fn compact(
&self,
selected: Vec<[u8; 16]>,
replacement: Vec<Item>,
) -> ContextMutation
pub fn compact( &self, selected: Vec<[u8; 16]>, replacement: Vec<Item>, ) -> ContextMutation
Prepare explicit replacement of selected items; no summary is generated.
Sourcepub fn release(&self) -> ContextMutation
pub fn release(&self) -> ContextMutation
Release only this revision’s own edge, never descendants or physical bytes.
Sourcepub fn transfer(&self, model: impl Into<String>) -> ContextMutation
pub fn transfer(&self, model: impl Into<String>) -> ContextMutation
Resolve a target model revision and replay this exact canonical content into a new Context.
Sourcepub fn generate(
&self,
input: impl Into<String>,
maximum_output: u64,
) -> GenerateRun
pub fn generate( &self, input: impl Into<String>, maximum_output: u64, ) -> GenerateRun
Prepare one recoverable generation against this exact immutable revision.
Sourcepub fn retain(&self, policy: Retention) -> RetainWarm
pub fn retain(&self, policy: Retention) -> RetainWarm
Prepare one replayable warm-retention admission for this exact revision.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl !UnwindSafe for Context
impl Freeze for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
T in a tonic::Request