pub struct ItemRef { /* private fields */ }Expand description
A reference to one item of the workspace’s vault: its address (vault.item:<id>), which
names it and is not its secret.
An agent may have one, pass it as an argument and keep it in a document. It opens nothing by itself: the host resolves it only for whoever the workspace’s vault lets reach the item, and only at a place the item belongs to. The id is random, so a reference cannot be guessed from another.
Implementations§
Source§impl ItemRef
impl ItemRef
Sourcepub fn from_id(id: &str) -> Option<Self>
pub fn from_id(id: &str) -> Option<Self>
The reference to the entry of the workspace’s vault id names, when id is an
entry’s id: 32 lowercase hexadecimal digits, or an older entry’s, the same spelled as a
UUID with its four hyphens.
Sourcepub fn target(&self, action: &str) -> RemoteActionTarget
pub fn target(&self, action: &str) -> RemoteActionTarget
The vault’s action action addressed at this item (vault.item:<id>#<action>), so a
grant on it is a grant on this one item alone.
Sourcepub fn addressed(target: &RemoteActionTarget, action: &str) -> Option<Self>
pub fn addressed(target: &RemoteActionTarget, action: &str) -> Option<Self>
The item an action at target of the vault is addressed at, when it is one of action
and addressed at an item.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ItemRef
impl<'de> Deserialize<'de> for ItemRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ItemRef
impl StructuralPartialEq for ItemRef
Auto Trait Implementations§
impl Forget for ItemRef
impl Freeze for ItemRef
impl Move for ItemRef
impl RefUnwindSafe for ItemRef
impl Send for ItemRef
impl Sync for ItemRef
impl Unpin for ItemRef
impl UnsafeUnpin for ItemRef
impl UnwindSafe for ItemRef
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more