twizzler_abi::runtime

Struct MinimalRuntime

source
pub struct MinimalRuntime {}

Implementations§

source§

impl MinimalRuntime

source

pub fn default_allocator(&self) -> &'static dyn GlobalAlloc

source

pub fn exit(&self, code: i32) -> !

source

pub fn abort(&self) -> !

source

pub fn pre_main_hook(&self) -> Option<i32>

source

pub fn post_main_hook(&self)

source

pub fn runtime_entry( &self, rt_info: *const RuntimeInfo, std_entry: unsafe extern "C-unwind" fn(_: BasicAux) -> BasicReturn, ) -> !

Called from _start to initialize the runtime and pass control to the Rust stdlib.

source

pub fn sysinfo(&self) -> SystemInfo

source

pub fn get_random(&self, buf: &mut [u8]) -> usize

source§

impl MinimalRuntime

source§

impl MinimalRuntime

source

pub fn open(&self, path: &str) -> Result<RawFd, OpenError>

source

pub fn read(&self, fd: RawFd, buf: &mut [u8]) -> Result<usize, IoError>

source

pub fn fd_pread( &self, fd: RawFd, off: Option<u64>, buf: &mut [u8], flags: IoFlags, ) -> Result<usize, IoError>

source

pub fn fd_pwrite( &self, fd: RawFd, off: Option<u64>, buf: &[u8], flags: IoFlags, ) -> Result<usize, IoError>

source

pub fn fd_pwritev( &self, fd: RawFd, off: Option<u64>, buf: &[io_vec], flags: IoFlags, ) -> Result<usize, IoError>

source

pub fn fd_preadv( &self, fd: RawFd, off: Option<u64>, buf: &[io_vec], flags: IoFlags, ) -> Result<usize, IoError>

source

pub fn fd_get_info(&self, fd: RawFd) -> Option<fd_info>

source

pub fn write(&self, fd: RawFd, buf: &[u8]) -> Result<usize, IoError>

source

pub fn close(&self, fd: RawFd) -> Option<()>

source

pub fn seek(&self, fd: RawFd, pos: SeekFrom) -> Result<usize, IoError>

source§

impl MinimalRuntime

source

pub fn map_object( &self, id: ObjID, flags: MapFlags, ) -> Result<ObjectHandle, MapError>

source

pub fn release_handle(&self, handle: *mut object_handle)

source

pub fn map_two_objects( &self, in_id_a: ObjID, in_flags_a: MapFlags, in_id_b: ObjID, in_flags_b: MapFlags, ) -> Result<(ObjectHandle, ObjectHandle), MapError>

Map two objects in sequence, useful for executable loading. The default implementation makes no guarantees about ordering.

source§

impl MinimalRuntime

source

pub fn available_parallelism(&self) -> NonZeroUsize

source

pub fn futex_wait( &self, futex: &AtomicU32, expected: u32, timeout: Option<Duration>, ) -> bool

source

pub fn futex_wake(&self, futex: &AtomicU32, count: usize) -> bool

source

pub fn spawn(&self, args: ThreadSpawnArgs) -> Result<u32, SpawnError>

source

pub fn yield_now(&self)

source

pub fn set_name(&self, _name: &CStr)

source

pub fn sleep(&self, duration: Duration)

source

pub fn join(&self, id: u32, timeout: Option<Duration>) -> Result<(), JoinError>

source

pub fn tls_get_addr(&self, _tls_index: &TlsIndex) -> Option<*mut u8>

source§

impl MinimalRuntime

Trait Implementations§

source§

impl Default for MinimalRuntime

source§

fn default() -> MinimalRuntime

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.