#[non_exhaustive]pub struct MemoryContextLease {
pub lease_id: MemoryLeaseId,
pub session_id: SessionId,
pub project_id: ProjectId,
pub provider_id: ContextProviderId,
pub mode: MemoryContextMode,
pub capture_policy: CapturePolicy,
pub recall_policy: RecallPolicy,
pub granted_by: UserIntentProof,
pub granted_at: SystemTime,
pub expires_at: Option<SystemTime>,
}Expand description
A host-granted continuous-memory lease (spec §6.2).
Construction is host-private (mirroring the authority discipline of
crate::orchestration::validate_user_authorizable_model): the only
constructor, MemoryContextLease::grant, is pub(crate), the struct is
#[non_exhaustive], and there is deliberately no Deserialize impl —
deserialization from extension or model output is forbidden.
Struct-literal construction outside the engine crate does not compile:
use agent_engine::runtime::memory_context::MemoryContextLease;
fn forge(lease: MemoryContextLease) -> MemoryContextLease {
// E0639: `MemoryContextLease` is `#[non_exhaustive]` outside its crate.
MemoryContextLease { ..lease }
}The grant constructor is inaccessible outside the engine crate:
use agent_engine::runtime::memory_context::MemoryContextLease;
fn probe() {
// E0624: `grant` is `pub(crate)`.
let _ = MemoryContextLease::grant;
}And no Deserialize impl exists, so wire input cannot mint a lease:
fn requires_deserialize<T: for<'de> serde::Deserialize<'de>>() {}
fn probe() {
// E0277: `MemoryContextLease: Deserialize` is not satisfied.
requires_deserialize::<agent_engine::runtime::memory_context::MemoryContextLease>();
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.lease_id: MemoryLeaseIdHost-minted lease identity.
session_id: SessionIdThe session this lease is scoped to.
project_id: ProjectIdThe project isolation boundary.
provider_id: ContextProviderIdThe context provider this lease activates.
mode: MemoryContextModeThe granted memory mode.
capture_policy: CapturePolicyThe capture policy in force under this lease.
recall_policy: RecallPolicyThe recall policy in force under this lease.
granted_by: UserIntentProofProof of the exact user intent that authorized this lease.
granted_at: SystemTimeWhen the host granted the lease.
expires_at: Option<SystemTime>Optional hard expiry; None means until revoked.
Trait Implementations§
Source§impl Clone for MemoryContextLease
impl Clone for MemoryContextLease
Source§impl Debug for MemoryContextLease
impl Debug for MemoryContextLease
impl Eq for MemoryContextLease
Source§impl PartialEq for MemoryContextLease
impl PartialEq for MemoryContextLease
impl StructuralPartialEq for MemoryContextLease
Auto Trait Implementations§
impl Freeze for MemoryContextLease
impl RefUnwindSafe for MemoryContextLease
impl Send for MemoryContextLease
impl Sync for MemoryContextLease
impl Unpin for MemoryContextLease
impl UnsafeUnpin for MemoryContextLease
impl UnwindSafe for MemoryContextLease
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
key and return true if they are equal.