Debian Codegraph @

/

debian rust-libc-print 0.5.0-1debian librust-libc-print-dev debian librust-libc-print+default-dev debian librust-libc-print-0-dev debian librust-libc-print-0+default-dev debian librust-libc-print-0.5-dev debian librust-libc-print-0.5+default-dev debian librust-libc-print-0.5.0-dev debian librust-libc-print-0.5.0+default-dev debianjsonmakefilemarkdownrustshelltomlyaml 20 files · 73 symbols
View dependency graph

Depends on

  • dh-cargo (dh-sequence-cargo)
  • rust-libc (librust-libc-0.2-dev)
  • cargo, debhelper-compat, libstd-rust-dev, rustc
README (full)

no_std libc print/println/eprint/eprintln/dbg

Build Status docs.rs crates.io

Implements println!, eprintln! and dbg! on the libc crate without requiring the use of an allocator.

Allows you to use these macros in a #![no_std] context, or in a situation where the traditional Rust streams might not be available (ie: at process shutdown time).

By default this crate provides libc_-prefixed macros, but also allows consumers to import macros with the same name as the stdlib printing macros via the std_name module.

Platform Support

For platforms with write in libc, this crate uses libc::write. For unknown and none OS targets, the user is required to provide a write function via the linker.

This crate support miri on all platforms, though it may choose different code paths for compatibility reasons.

Usage

Exactly as you'd use println!, eprintln! and dbg!.

#![no_std]

// Use the default `libc_`-prefixed macros:
libc_println!("Hello {}!", "stdout");
libc_eprintln!("Hello {}!", "stderr");
let a = 2;
let b = libc_dbg!(a * 2) + 1;
assert_eq!(b, 5);

Or you can import aliases to std names:

use libc_print::std_name::{println, eprintln, dbg};

println!("Hello {}!", "stdout");
eprintln!("Hello {}!", "stderr");
let a = 2;
let b = dbg!(a * 2) + 1;
assert_eq!(b, 5);
dir .github/
dir debian/
dir examples/
dir src/
file .cargo_vcs_info.json
file .gitignore
file Cargo.lock
file Cargo.toml
file Cargo.toml.orig
file LICENSE-APACHE
file LICENSE-MIT
file README.md