All Projects → technocreatives → core2

technocreatives / core2

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE-APACHE MIT LICENSE-MIT
The bare essentials of std::io for use in no_std. Alloc support is optional.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to core2

Eslint Plugin Compat
Lint the browser compatibility of your code
Stars: ✭ 2,743 (+3994.03%)
Mutual labels:  polyfill, compat
m
Deprecated in favor of the libm crate.
Stars: ✭ 27 (-59.7%)
Mutual labels:  no-std
barcode-detector
Spec compliant polyfill of the Barcode Detection API 🤳
Stars: ✭ 31 (-53.73%)
Mutual labels:  polyfill
IsExternalInit
A source code only package which allows you to use C# 9's init and record features in older target frameworks like .NET Standard 2.0 or the "old" .NET Framework by providing a polyfill for the IsExternalInit class.
Stars: ✭ 75 (+11.94%)
Mutual labels:  polyfill
focus-options-polyfill
JavaScript polyfill for the WHATWG spec of focusOptions, that enables a set of options to be passed to the focus method
Stars: ✭ 46 (-31.34%)
Mutual labels:  polyfill
draggable-polyfill
🌈a beautify polyfill for native drag!
Stars: ✭ 49 (-26.87%)
Mutual labels:  polyfill
rust-amplify
Amplifying Rust language capabilities: multiple generic trait implementations, type wrappers, bit-precise numerics, derive macros
Stars: ✭ 38 (-43.28%)
Mutual labels:  no-std
semval
Semantic validation for Rust
Stars: ✭ 77 (+14.93%)
Mutual labels:  no-std
traits
R package for accessing species trait data from multiple databases
Stars: ✭ 38 (-43.28%)
Mutual labels:  traits
drone-stm32-map
STM32 peripheral mappings for Drone, an Embedded Operating System.
Stars: ✭ 16 (-76.12%)
Mutual labels:  no-std
polyfill-php74
This component provides functions unavailable in releases prior to PHP 7.4.
Stars: ✭ 26 (-61.19%)
Mutual labels:  polyfill
alloc-cortex-m
A heap allocator for Cortex-M processors
Stars: ✭ 139 (+107.46%)
Mutual labels:  no-std
m4vga-rs
VGA-style video output for STM32F4 processors, in Rust
Stars: ✭ 122 (+82.09%)
Mutual labels:  no-std
scoper
A polyfill for scoped HTML styles elements
Stars: ✭ 79 (+17.91%)
Mutual labels:  polyfill
react-native-console-time-polyfill
console.time and console.timeEnd polyfill for react-native
Stars: ✭ 92 (+37.31%)
Mutual labels:  polyfill
register-rs
Unified interface for type-safe MMIO and CPU register access in Rust
Stars: ✭ 48 (-28.36%)
Mutual labels:  no-std
fixedvec-rs
Heapless vector implementation for Rust
Stars: ✭ 39 (-41.79%)
Mutual labels:  no-std
PHPUnit-Polyfills
Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests
Stars: ✭ 147 (+119.4%)
Mutual labels:  polyfill
parsed-html-rewriter
A DOM-based implementation of Cloudflare Worker's HTMLRewriter.
Stars: ✭ 34 (-49.25%)
Mutual labels:  polyfill
vcell
Just like `Cell` but with volatile read / write operations
Stars: ✭ 16 (-76.12%)
Mutual labels:  no-std

core2

Actions Status Documentation Minimum Supported Rust Version (MSRV)

Ever wanted a Cursor or the Error trait in no_std? Well now you can have it. A 'fork' of Rust's std modules for no_std environments, with the added benefit of optionally taking advantage of alloc.

The goal of this crate is to provide a stable interface for building I/O and error trait functionality in no_std environments. The current code corresponds to the most recent stable API of Rust 1.47.0. It is also a goal to achieve a true alloc-less experience, with opt-in alloc support.

This crate works on stable with some limitations in functionality, and nightly without limitations by adding the relevant feature flag.

This crate is std by default -- use no default features to get no_std mode.

Usage

[dependencies]
core2 = "0.3"

Add the crate, use the things you would usually want from std::io, but instead from core2::io, and use core2::error::Error in place of std::error::Error.

Features

  • std: enables std pass-throughs for the polyfilled types, but allows accessing the new types
  • alloc: enable aspects of the Read and Write traits that require alloc support (WIP)
  • nightly: enables nightly-only features, such as BufReader and BufWriter with const generic buffers.

Differences to std::io

  • No std::io::Error, so we have our own copy without any Os error functions
  • IoSlice and the *_vectored family of functions are not implemented.
  • BufReader and BufWriter have a different signature, as they now use a const generic bounded array for the internal buffer. (Requires nightly feature)

Other than items perhaps being entirely missing or certain functions unavailable on some traits, no function signatures have been changed.

Limitations

  • Using the buffer types currently requires nightly due to the use of const generics.
  • Using copy or the buffer types with std support currently requires nightly due to the initializer API.

Where is it used?

All of the below are works in progress, but should help with demonstrating how to use this crate.

License

Licensed under either of

at your option.


Almost all of the code in this repository is a copy of the Rust language codebase with minor modifications.

For attributions, see https://thanks.rust-lang.org/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].