pub struct Sovereign<T> { /* private fields */ }Expand description
A wrapper that enforces ownership semantics across network boundaries.
“Memory safety with sovereign integrity.”
Implementations§
Source§impl<T> Sovereign<T>
impl<T> Sovereign<T>
Sourcepub fn annex(&self) -> Result<(), String>
pub fn annex(&self) -> Result<(), String>
Annexes the resource, moving it to foreign jurisdiction.
Once annexed, the resource cannot be accessed locally. Access attempts will result in a Sovereignty Violation (panic).
Sourcepub fn inner_ref(&self) -> &T
pub fn inner_ref(&self) -> &T
Returns a reference to the inner value without jurisdiction check.
§Safety
This is safe because we’re returning a shared reference and the caller is responsible for ensuring the resource is domestic.
Sourcepub fn state(&self) -> SovereignState
pub fn state(&self) -> SovereignState
Returns the current state of the resource.
Trait Implementations§
Source§impl<T> DistributedBorrow<T> for Sovereign<T>
impl<T> DistributedBorrow<T> for Sovereign<T>
impl<T: Send> Send for Sovereign<T>
impl<T: Sync> Sync for Sovereign<T>
Auto Trait Implementations§
impl<T> !Freeze for Sovereign<T>
impl<T> !RefUnwindSafe for Sovereign<T>
impl<T> Unpin for Sovereign<T>where
T: Unpin,
impl<T> UnwindSafe for Sovereign<T>where
T: 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