API reference Dodo 0.1.4

std/sync/allocated

Public declarations, types, methods, and source contracts for std/sync/allocated.

On this page

Library guide · API index and notation

This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.

import "std/sync/allocated"

Names used in signatures

Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.

Alias Package Source file
atomic std/sync/atomic allocated.dodo
error std/sync/error allocated.dodo
mem core/mem allocated.dodo
native std/sync/native allocated.dodo
ptr core/ptr allocated.dodo

PageAllocator

Struct · Source

Explicit allocation capability: each constructor maps private OS pages. No process-global allocator, allocator borrow, or scheduler is introduced.

pub struct PageAllocator {

}

PageAllocator.new

Function · Source

pub fn new() -> PageAllocator

Mutex

Struct · Source

SAFETY: only checked Send payloads enter private storage; shared access is synchronized. References never escape their guards, and every clone retains the stable mapping until the last owner and all its guards have ended.

@unsafe_send
@unsafe_sync
pub struct Mutex<T> {
    // Private implementation fields omitted.
}

Mutex.new

Function · Source

pub fn new(allocator: PageAllocator, value: T) -> Mutex<T>!error.Error

Mutex.clone

Function · Source

pub fn clone(&self) -> Mutex<T>

Mutex.lock

Function · Source

pub fn lock(&self, timeout: u64) -> Guard<T>!error.Error from(self)

Mutex.notify_one

Function · Source

pub fn notify_one(&self)

Mutex.notify_all

Function · Source

pub fn notify_all(&self)

Mutex.condition

Function · Source

pub fn condition(&self) -> ConditionVariable<T> from(self)

Mutex.cancel

Function · Source

pub fn cancel(&self)

Guard

Struct · Source

pub struct Guard<T> {
    // Private implementation fields omitted.
}

Guard.get

Function · Source

pub fn get(&self) -> &T from(self)

Guard.get_mut

Function · Source

pub fn get_mut(&mut self) -> &mut T from(self)

Guard.wait

Function · Source

pub fn wait(&mut self, timeout: u64) -> void!error.Error

RwLock

Struct · Source

SAFETY: only checked Send payloads enter private storage; shared access is synchronized. References never escape their guards, and every clone retains the stable mapping until the last owner and all its guards have ended.

@unsafe_send
@unsafe_sync
pub struct RwLock<T> {
    // Private implementation fields omitted.
}

RwLock.new

Function · Source

pub fn new(allocator: PageAllocator, value: T) -> RwLock<T>!error.Error

RwLock.clone

Function · Source

pub fn clone(&self) -> RwLock<T>

RwLock.read

Function · Source

pub fn read(&self, timeout: u64) -> ReadGuard<T>!error.Error from(self)

RwLock.write

Function · Source

pub fn write(&self, timeout: u64) -> WriteGuard<T>!error.Error from(self)

RwLock.cancel

Function · Source

pub fn cancel(&self)

ReadGuard

Struct · Source

pub struct ReadGuard<T> {
    // Private implementation fields omitted.
}

ReadGuard.get

Function · Source

pub fn get(&self) -> &T from(self)

WriteGuard

Struct · Source

pub struct WriteGuard<T> {
    // Private implementation fields omitted.
}

WriteGuard.get

Function · Source

pub fn get(&self) -> &T from(self)

WriteGuard.get_mut

Function · Source

pub fn get_mut(&mut self) -> &mut T from(self)

ConditionVariable

Struct · Source

pub struct ConditionVariable<T> {
    // Private implementation fields omitted.
}

ConditionVariable.wait

Function · Source

pub fn wait(&self, guard: &mut Guard<T>, timeout: u64) -> void!error.Error

ConditionVariable.notify_one

Function · Source

pub fn notify_one(&self)

ConditionVariable.notify_all

Function · Source

pub fn notify_all(&self)

Barrier

Struct · Source

@unsafe_send
@unsafe_sync
pub struct Barrier {
    // Private implementation fields omitted.
}

Barrier.new

Function · Source

pub fn new(allocator: PageAllocator, parties: usize) -> Barrier!error.Error

Barrier.clone

Function · Source

pub fn clone(&self) -> Barrier

Barrier.wait

Function · Source

pub fn wait(&self, timeout: u64) -> void!error.Error

Barrier.cancel

Function · Source

pub fn cancel(&self)

Channel

Struct · Source

@unsafe_send
@unsafe_sync
pub struct Channel<T> {
    // Private implementation fields omitted.
}

Channel.new

Function · Source

pub fn new(allocator: PageAllocator, capacity: usize) -> Channel<T>!error.Error

Channel.clone

Function · Source

pub fn clone(&self) -> Channel<T>

Channel.send

Function · Source

pub fn send(&self, value: T, timeout: u64) -> void!error.Error

Channel.receive

Function · Source

pub fn receive(&self, timeout: u64) -> Option<T>!error.Error

Channel.close

Function · Source

pub fn close(&self)

Channel.cancel

Function · Source

pub fn cancel(&self)

Once

Struct · Source

pub struct Once<T> {
    // Private implementation fields omitted.
}

Once.new

Function · Source

pub fn new(allocator: PageAllocator) -> Once<T>!error.Error

Once.clone

Function · Source

pub fn clone(&self) -> Once<T>

Once.get_or_init

Function · Source

pub fn get_or_init<I>(&self, initializer: &mut I, timeout: u64) -> OnceGuard<T>!error.Error from(self)

OnceGuard

Struct · Source

pub struct OnceGuard<T> {
    // Private implementation fields omitted.
}

OnceGuard.get

Function · Source

pub fn get(&self) -> &Option<T> from(self)

Atomic

Struct · Source

A retained stable allocation for sharing actual lock-free atomic payload operations. Retain/release use an OS lock and are not lock-free operations.

@unsafe_send
@unsafe_sync
pub struct Atomic<T> {
    // Private implementation fields omitted.
}

Atomic.new

Function · Source

pub fn new(allocator: PageAllocator, value: T) -> Atomic<T>!error.Error

Atomic.clone

Function · Source

pub fn clone(&self) -> Atomic<T>

Atomic.load

Function · Source

pub fn load(&self, order: atomic.Ordering) -> T!error.Error

Atomic.store

Function · Source

pub fn store(&self, value: T, order: atomic.Ordering) -> void!error.Error

Atomic.exchange

Function · Source

pub fn exchange(&self, value: T, order: atomic.Ordering) -> T!error.Error

Atomic.fetch_add

Function · Source

pub fn fetch_add(&self, value: T, order: atomic.Ordering) -> T!error.Error

Atomic.compare_exchange

Function · Source

pub fn compare_exchange(&self, expected: T, replacement: T, success: atomic.Ordering, failure: atomic.Ordering) -> atomic.CompareExchange<T>!error.Error

Type to search all documentation.

Keyboard shortcuts

Search documentation
Ctrl K or /
Move through results
↑ ↓
Open selected result
Enter
Close a dialog
Esc
Show these shortcuts
?