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/platform/linux"
This is a provider or implementation package. Start with the linked guide’s application API; native declarations depend on the selected target.
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 |
|---|---|---|
error |
std/platform/error |
linux.dodo |
io |
std/io |
linux.dodo |
mem |
core/mem |
linux.dodo |
ptr |
core/ptr |
linux.dodo |
text |
std/text |
linux.dodo |
NativeString
Struct · Source
Native code units including exactly one final NUL. Interior NUL is rejected. Unix bytes are never implicitly decoded; Windows u16 may contain unpaired surrogates. The borrow keeps caller-owned storage alive across foreign calls.
pub struct NativeString {
// Private implementation fields omitted.
}
NativeString.new
Function · Source
pub fn new(units: &[u8]) -> NativeString!error.Error from(units)
NativeString.as_ptr
Function · Source
pub fn as_ptr(&self) -> *const u8
NativeString.units
Function · Source
pub fn units(&self) -> &[u8]
NativeString.terminated
Function · Source
pub fn terminated(&self) -> &[u8]
NativeList
Struct · Source
Consecutive NUL-terminated native strings. Empty lists are valid. A final empty element is represented by an additional NUL; no implicit sentinel.
pub struct NativeList {
// Private implementation fields omitted.
}
NativeList.new
Function · Source
pub fn new(units: &[u8]) -> NativeList!error.Error from(units)
NativeList.as_ptr
Function · Source
pub fn as_ptr(&self) -> *const u8
NativeList.units
Function · Source
pub fn units(&self) -> &[u8]
from_code
Function · Source
pub fn from_code(code: i32) -> error.Error
last_error
Function · Source
pub fn last_error() -> error.Error
from_utf8
Function · Source
pub fn from_utf8(value: &str, bytes: &mut[u8], wide: &mut[u16]) -> NativeString!error.Error from(bytes, wide)
to_utf8
Function · Source
Explicit replacement: one U+FFFD for each malformed Unix byte. Native conversions are otherwise strict, caller-backed, and never locale-dependent.
pub fn to_utf8(value: &NativeString, output: &mut[u8], lossy: bool) -> usize!error.Error
Handle
Struct · Source
Unique owning descriptor. close invalidates first: Linux close(EINTR) must never be retried, since the descriptor number may already have been reused.
pub struct Handle {
// Private implementation fields omitted.
}
Handle.from_raw
Function · Source
pub unsafe fn from_raw(raw: isize) -> Handle
Requires an unsafe context. Follow the source safety preconditions and the linked guide before calling this API.
Handle.raw
Function · Source
pub fn raw(&self) -> isize
Handle.close
Function · Source
pub fn close(&mut self) -> void!error.Error
Handle.read
Function · Source
pub fn read(&mut self, output: &mut[u8]) -> usize!io.Error
Handle.write
Function · Source
pub fn write(&mut self, input: &[u8]) -> usize!io.Error
Handle.seek
Function · Source
pub fn seek(&mut self, position: usize) -> usize!io.Error
Handle.sync
Function · Source
pub fn sync(&mut self) -> void!error.Error
Handle.truncate
Function · Source
pub fn truncate(&mut self, length: u64) -> void!error.Error
TEXT_CAPACITY
Constant · Source
Bounded inline native text storage. Units include the terminating NUL. Only the selected platform representation is stored; no allocation occurs.
pub const TEXT_CAPACITY: usize = 4096
LIST_CAPACITY
Constant · Source
pub const LIST_CAPACITY: usize = 32768
Workspace
Struct · Source
pub struct Workspace {
// Private implementation fields omitted.
}
Workspace.new
Function · Source
pub fn new() -> Workspace
Workspace.set
Function · Source
Failure preserves the previous string. All capacity checks precede writes.
pub fn set(&mut self, value: &str) -> void!error.Error
Workspace.get
Function · Source
pub fn get(&self) -> NativeString!error.Error
Workspace.buffer
Function · Source
Native observations use separate caller-owned storage. commit validates the returned length and terminator before publishing a view.
pub fn buffer(&mut self) -> &mut[u8]
Workspace.commit
Function · Source
pub fn commit(&mut self, used: usize) -> void!error.Error
ListWorkspace
Struct · Source
pub struct ListWorkspace {
// Private implementation fields omitted.
}
ListWorkspace.new
Function · Source
pub fn new() -> ListWorkspace
ListWorkspace.empty
Function · Source
pub fn empty(&self) -> NativeList
ListWorkspace.len_units
Function · Source
pub fn len_units(&self) -> usize
ListWorkspace.clear
Function · Source
pub fn clear(&mut self)
ListWorkspace.push
Function · Source
Each call appends exactly one argument, including an empty argument. Failed append preserves all previous arguments and the logical length.
pub fn push(&mut self, value: &str) -> void!error.Error
ListWorkspace.get
Function · Source
pub fn get(&self) -> NativeList!error.Error
ListWorkspace.buffer
Function · Source
pub fn buffer(&mut self) -> &mut[u8]
ListWorkspace.commit
Function · Source
pub fn commit(&mut self, used: usize) -> void!error.Error
BorrowedHandle
Struct · Source
Borrowed process standard stream: deliberately has no close or destructor. Native replacement/closure by foreign code is observed as ordinary I/O.
pub struct BorrowedHandle {
// Private implementation fields omitted.
}
BorrowedHandle.read
Function · Source
pub fn read(&mut self, output: &mut[u8]) -> usize!io.Error
BorrowedHandle.write
Function · Source
pub fn write(&mut self, input: &[u8]) -> usize!io.Error
stdin
Function · Source
pub fn stdin() -> BorrowedHandle
stdout
Function · Source
pub fn stdout() -> BorrowedHandle
stderr
Function · Source
pub fn stderr() -> BorrowedHandle