Struct kay::External [−][src]
pub struct External<T> { /* fields omitted */ }
An owning reference to local state outside the actor system that can safely be embedded in actor states and passed in messages, as long as they stay on one machine.
Methods
impl<T> External<T>
[src]
impl<T> External<T>
pub fn new(content: T) -> Self
[src]
pub fn new(content: T) -> Self
Allocate content
on the heap and create a sharable External
reference to it
pub fn from_box(content: Box<T>) -> Self
[src]
pub fn from_box(content: Box<T>) -> Self
To interface with traditional owned boxes
pub fn steal(&self) -> Self
[src]
pub fn steal(&self) -> Self
Like clone
, just to make the danger more clear
pub fn into_box(self) -> Box<T>
[src]
pub fn into_box(self) -> Box<T>
To interface with traditional owned boxes
Trait Implementations
impl<T> Clone for External<T>
[src]
impl<T> Clone for External<T>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> Deref for External<T>
[src]
impl<T> Deref for External<T>
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &T
[src]
fn deref(&self) -> &T
Dereferences the value.
impl<T> DerefMut for External<T>
[src]
impl<T> DerefMut for External<T>
impl<T> Compact for External<T>
[src]
impl<T> Compact for External<T>
fn is_still_compact(&self) -> bool
[src]
fn is_still_compact(&self) -> bool
Is the object's dynamic part stored compactly?
fn dynamic_size_bytes(&self) -> usize
[src]
fn dynamic_size_bytes(&self) -> usize
Size of the dynamic part in bytes
unsafe fn compact(
source: *mut Self,
dest: *mut Self,
_new_dynamic_part: *mut u8
)
[src]
unsafe fn compact(
source: *mut Self,
dest: *mut Self,
_new_dynamic_part: *mut u8
)
Copy the static part of source
to dest
and compactly store the dynamic part of source
as the new dynamic part of dest
at new_dynamic_part
. This semantically moves source into dest. Read more
unsafe fn decompact(source: *const Self) -> Self
[src]
unsafe fn decompact(source: *const Self) -> Self
Creates a clone of self with the dynamic part guaranteed to be stored freely. Read more
fn total_size_bytes(&self) -> usize
[src]
fn total_size_bytes(&self) -> usize
Total size of the object (static part + dynamic part)
unsafe fn behind(ptr: *mut Self) -> *mut u8
[src]
unsafe fn behind(ptr: *mut Self) -> *mut u8
Get a pointer to behind the static part of self
(commonly used place for the dynamic part)
unsafe fn compact_behind(source: *mut Self, dest: *mut Self)
[src]
unsafe fn compact_behind(source: *mut Self, dest: *mut Self)
Like compact
with new_dynamic_part
set to dest.behind()