pub struct Config {
pub link: Link,
pub capacity: Capacity,
}Expand description
The config used for spawning new processes, made up of a Link and a Capacity. This decides whether the actor will be attached/detached and unbounded/bounded.
§Example
use tiny_actor::*;
Config {
link: Link::default(),
capacity: Capacity::default(),
};§Default
Attached with an abort-timer of 1 sec.
The capacity is unbounded, with exponential backoff starting 5 messages in the inbox
at 25 ns, with a growth-factor of 1.3.
Fields§
§link: Link§capacity: CapacityImplementations§
Source§impl Config
impl Config
pub fn new(link: Link, capacity: Capacity) -> Self
Sourcepub fn bounded(capacity: usize) -> Self
pub fn bounded(capacity: usize) -> Self
A config for a default bounded [Channel]:
Config {
link: Link::default(),
capacity: Capacity::Bounded(capacity),
};Sourcepub fn detached() -> Self
pub fn detached() -> Self
A default bounded inbox:
Config {
link: Link::Detached,
capacity: Capacity::default(),
};pub fn attached(timeout: Duration) -> Self
Trait Implementations§
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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