Crate fringe [] [src]

libfringe is a library implementing safe, lightweight context switches, without relying on kernel services. It can be used in hosted environments (using std) as well as on bare metal (using core).

It provides the following safe abstractions:

  • an implementation of generators, Generator.

It also provides the necessary low-level building blocks:

  • a trait that can be implemented by stack allocators, Stack;
  • a wrapper for using slice references as stacks, SliceStack;
  • a stack allocator based on Box<[u8]>, OwnedStack;
  • a stack allocator based on anonymous memory mappings with guard pages, OsStack.

Reexports

pub use generator::Generator;

Modules

generator

Generators.

Structs

OsStack

OsStack holds a guarded stack allocated using the operating system's anonymous memory mapping facility.

OwnedStack

OwnedStack holds a non-guarded, heap-allocated stack.

SliceStack

SliceStack holds a non-guarded stack allocated elsewhere and provided as a mutable slice.

Constants

STACK_ALIGNMENT

Minimum alignment of a stack base address on the target platform.

Traits

GuardedStack

A marker trait for Stack objects with a guard page.

Stack

A trait for objects that hold ownership of a stack.