pub struct ManagedOwner { /* private fields */ }Expand description
Who a managed session belongs to.
Every managed session was previously persisted under the constants managed /
managed_user, so all sessions shared one logical namespace: session lookup, memory, and
deletion could not be scoped to a caller, and audit could not attribute a session to
anyone. The runtime needs this at creation because the underlying SessionService is
addressed by app and user, and substituting constants to satisfy that contract is what
erased the caller.
§Example
use adk_managed::ManagedOwner;
let owner = ManagedOwner::new("support-console", "user-42")?;
assert_eq!(owner.app_name(), "support-console");
// Blank components are rejected, since they would silently re-create a shared namespace.
assert!(ManagedOwner::new("", "user-42").is_err());Implementations§
Source§impl ManagedOwner
impl ManagedOwner
Sourcepub fn new(
app_name: impl Into<String>,
user_id: impl Into<String>,
) -> Result<Self, RuntimeError>
pub fn new( app_name: impl Into<String>, user_id: impl Into<String>, ) -> Result<Self, RuntimeError>
Validates and builds an owner identity.
§Errors
Returns RuntimeError::InvalidRequest when either component is empty or whitespace.
Trait Implementations§
Source§impl Clone for ManagedOwner
impl Clone for ManagedOwner
Source§fn clone(&self) -> ManagedOwner
fn clone(&self) -> ManagedOwner
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 ManagedOwner
impl Debug for ManagedOwner
impl Eq for ManagedOwner
Source§impl Hash for ManagedOwner
impl Hash for ManagedOwner
Source§impl PartialEq for ManagedOwner
impl PartialEq for ManagedOwner
impl StructuralPartialEq for ManagedOwner
Auto Trait Implementations§
impl Freeze for ManagedOwner
impl RefUnwindSafe for ManagedOwner
impl Send for ManagedOwner
impl Sync for ManagedOwner
impl Unpin for ManagedOwner
impl UnsafeUnpin for ManagedOwner
impl UnwindSafe for ManagedOwner
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.