• Home
  • Raw
  • Download

Lines Matching +full:rust +full:- +full:embedded

1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
20 //! is very small - just an integer load, comparison and jump.
31 //! where `error!` represents the highest-priority log messages
42 //! [`println!`]: https://doc.rust-lang.org/stable/std/macro.println.html
54 //! # fn find_a_razor() -> Result<u32, u32> { Ok(1) }
99 //! # fn find_a_razor() -> Result<u32, std::io::Error> { Ok(1) }
144 //! * [slog-stdlog]
145 //! * [systemd-journal-logger]
152 //! * You may need to construct an FFI-safe wrapper over `log` to initialize in your libraries
166 //! fn enabled(&self, metadata: &Metadata) -> bool {
172 //! println!("{} - {}", record.level(), record.args());
197 //! # fn enabled(&self, _: &Metadata) -> bool { false }
206 //! pub fn init() -> Result<(), SetLoggerError> {
227 //! # fn enabled(&self, _: &Metadata) -> bool { false }
233 //! pub fn init() -> Result<(), SetLoggerError> {
300 //! [simple_logger]: https://github.com/borntyping/rust-simple_logger
306 //! [slog-stdlog]: https://docs.rs/slog-stdlog/*/slog_stdlog/
309 //! [systemd-journal-logger]: https://docs.rs/systemd-journal-logger/*/systemd_journal_logger/
315 html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
316 html_favicon_url = "https://www.rust-lang.org/favicon.ico",
363 const fn new(v: usize) -> AtomicUsize { in new()
367 fn load(&self, _order: Ordering) -> usize { in load()
382 ) -> Result<usize, usize> { in compare_exchange()
431 // This works because Rust treats field-less enums the same way as C does:
432 …// https://doc.rust-lang.org/reference/items/enumerations.html#custom-discriminant-values-for-fiel…
454 fn clone(&self) -> Level { in clone()
461 fn eq(&self, other: &Level) -> bool { in eq()
468 fn eq(&self, other: &LevelFilter) -> bool { in eq()
475 fn partial_cmp(&self, other: &Level) -> Option<cmp::Ordering> { in partial_cmp()
480 fn lt(&self, other: &Level) -> bool { in lt()
485 fn le(&self, other: &Level) -> bool { in le()
490 fn gt(&self, other: &Level) -> bool { in gt()
495 fn ge(&self, other: &Level) -> bool { in ge()
502 fn partial_cmp(&self, other: &LevelFilter) -> Option<cmp::Ordering> { in partial_cmp()
507 fn lt(&self, other: &LevelFilter) -> bool { in lt()
512 fn le(&self, other: &LevelFilter) -> bool { in le()
517 fn gt(&self, other: &LevelFilter) -> bool { in gt()
522 fn ge(&self, other: &LevelFilter) -> bool { in ge()
529 fn cmp(&self, other: &Level) -> cmp::Ordering { in cmp()
534 fn ok_or<T, E>(t: Option<T>, e: E) -> Result<T, E> { in ok_or()
542 fn eq_ignore_ascii_case(a: &str, b: &str) -> bool { in eq_ignore_ascii_case()
543 fn to_ascii_uppercase(c: u8) -> u8 { in eq_ignore_ascii_case()
545 c - b'a' + b'A' in eq_ignore_ascii_case()
562 fn from_str(level: &str) -> Result<Level, Self::Err> { in from_str()
577 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { in fmt()
583 fn from_usize(u: usize) -> Option<Level> { in from_usize()
596 pub fn max() -> Level { in max()
602 pub fn to_level_filter(&self) -> LevelFilter { in to_level_filter()
609 pub fn as_str(&self) -> &'static str { in as_str()
627 pub fn iter() -> impl Iterator<Item = Self> { in iter()
661 fn clone(&self) -> LevelFilter { in clone()
668 fn eq(&self, other: &LevelFilter) -> bool { in eq()
675 fn eq(&self, other: &Level) -> bool { in eq()
682 fn partial_cmp(&self, other: &LevelFilter) -> Option<cmp::Ordering> { in partial_cmp()
687 fn lt(&self, other: &LevelFilter) -> bool { in lt()
692 fn le(&self, other: &LevelFilter) -> bool { in le()
697 fn gt(&self, other: &LevelFilter) -> bool { in gt()
702 fn ge(&self, other: &LevelFilter) -> bool { in ge()
709 fn partial_cmp(&self, other: &Level) -> Option<cmp::Ordering> { in partial_cmp()
714 fn lt(&self, other: &Level) -> bool { in lt()
719 fn le(&self, other: &Level) -> bool { in le()
724 fn gt(&self, other: &Level) -> bool { in gt()
729 fn ge(&self, other: &Level) -> bool { in ge()
736 fn cmp(&self, other: &LevelFilter) -> cmp::Ordering { in cmp()
743 fn from_str(level: &str) -> Result<LevelFilter, Self::Err> { in from_str()
755 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { in fmt()
761 fn from_usize(u: usize) -> Option<LevelFilter> { in from_usize()
775 pub fn max() -> LevelFilter { in max()
783 pub fn to_level(&self) -> Option<Level> { in to_level()
790 pub fn as_str(&self) -> &'static str { in as_str()
808 pub fn iter() -> impl Iterator<Item = Self> { in iter()
821 fn get(&self) -> &'a str { in get()
851 /// fn enabled(&self, metadata: &log::Metadata) -> bool {
860 /// println!("{}:{} -- {}",
895 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { in fmt()
905 pub fn builder() -> RecordBuilder<'a> { in builder()
911 pub fn args(&self) -> &fmt::Arguments<'a> { in args()
917 pub fn metadata(&self) -> &Metadata<'a> { in metadata()
923 pub fn level(&self) -> Level { in level()
929 pub fn target(&self) -> &'a str { in target()
935 pub fn module_path(&self) -> Option<&'a str> { in module_path()
941 pub fn module_path_static(&self) -> Option<&'static str> { in module_path_static()
950 pub fn file(&self) -> Option<&'a str> { in file()
956 pub fn file_static(&self) -> Option<&'static str> { in file_static()
965 pub fn line(&self) -> Option<u32> { in line()
969 /// The structured key-value pairs associated with the message.
972 pub fn key_values(&self) -> &dyn kv::Source { in key_values()
979 pub fn to_builder(&self) -> RecordBuilder { in to_builder()
1045 /// - `args`: [`format_args!("")`]
1046 /// - `metadata`: [`Metadata::builder().build()`]
1047 /// - `module_path`: `None`
1048 /// - `file`: `None`
1049 /// - `line`: `None`
1051 /// [`format_args!("")`]: https://doc.rust-lang.org/std/macro.format_args.html
1054 pub fn new() -> RecordBuilder<'a> { in new()
1070 pub fn args(&mut self, args: fmt::Arguments<'a>) -> &mut RecordBuilder<'a> { in args()
1077 pub fn metadata(&mut self, metadata: Metadata<'a>) -> &mut RecordBuilder<'a> { in metadata()
1084 pub fn level(&mut self, level: Level) -> &mut RecordBuilder<'a> { in level()
1091 pub fn target(&mut self, target: &'a str) -> &mut RecordBuilder<'a> { in target()
1098 pub fn module_path(&mut self, path: Option<&'a str>) -> &mut RecordBuilder<'a> { in module_path()
1105 pub fn module_path_static(&mut self, path: Option<&'static str>) -> &mut RecordBuilder<'a> { in module_path_static()
1112 pub fn file(&mut self, file: Option<&'a str>) -> &mut RecordBuilder<'a> { in file()
1119 pub fn file_static(&mut self, file: Option<&'static str>) -> &mut RecordBuilder<'a> { in file_static()
1126 pub fn line(&mut self, line: Option<u32>) -> &mut RecordBuilder<'a> { in line()
1134 pub fn key_values(&mut self, kvs: &'a dyn kv::Source) -> &mut RecordBuilder<'a> { in key_values()
1141 pub fn build(&self) -> Record<'a> { in build()
1170 /// fn enabled(&self, metadata: &Metadata) -> bool {
1176 /// println!("{} - {}", record.level(), record.args());
1193 pub fn builder() -> MetadataBuilder<'a> { in builder()
1199 pub fn level(&self) -> Level { in level()
1205 pub fn target(&self) -> &'a str { in target()
1236 /// - `level`: `Level::Info`
1237 /// - `target`: `""`
1239 pub fn new() -> MetadataBuilder<'a> { in new()
1250 pub fn level(&mut self, arg: Level) -> &mut MetadataBuilder<'a> { in level()
1257 pub fn target(&mut self, target: &'a str) -> &mut MetadataBuilder<'a> { in target()
1264 pub fn build(&self) -> Metadata<'a> { in build()
1283 fn enabled(&self, metadata: &Metadata) -> bool; in enabled()
1302 fn enabled(&self, _: &Metadata) -> bool { in enabled()
1314 fn enabled(&self, metadata: &Metadata) -> bool { in enabled()
1331 fn enabled(&self, metadata: &Metadata) -> bool { in enabled()
1348 fn enabled(&self, metadata: &Metadata) -> bool { in enabled()
1384 pub fn max_level() -> LevelFilter { in max_level()
1408 pub fn set_boxed_logger(logger: Box<dyn Log>) -> Result<(), SetLoggerError> { in set_boxed_logger()
1442 /// fn enabled(&self, metadata: &Metadata) -> bool {
1448 /// println!("{} - {}", record.level(), record.args());
1466 pub fn set_logger(logger: &'static dyn Log) -> Result<(), SetLoggerError> { in set_logger()
1471 fn set_logger_inner<F>(make_logger: F) -> Result<(), SetLoggerError> in set_logger_inner()
1473 F: FnOnce() -> &'static dyn Log, in set_logger_inner()
1503 /// A thread-unsafe version of [`set_logger`].
1516 /// threads**, and (on embedded) that **interrupts are disabled**.
1522 pub unsafe fn set_logger_racy(logger: &'static dyn Log) -> Result<(), SetLoggerError> { in set_logger_racy()
1545 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { in fmt()
1556 /// [`from_str`]: https://doc.rust-lang.org/std/str/trait.FromStr.html#tymethod.from_str
1562 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { in fmt()
1573 /// If a logger has not been set, a no-op implementation is returned.
1574 pub fn logger() -> &'static dyn Log { in logger()
1594 "key-value support is experimental and must be enabled using the `kv_unstable` feature" in __private_api_log()
1634 pub fn __private_api_enabled(level: Level, target: &str) -> bool { in __private_api_enabled()
1907 ) -> Result<(), kv::Error> { in test_record_key_values_builder()