Expand description
The rmx
prelude.
Re-exports§
pub use ::anyhow::Context as _;
pub use ::itertools::Itertools as _;
pub use crate::extras::default;
pub use crate::extras::S;
pub use crate::extras::O;
pub use crate::extras::AnyResultExpect as _;
pub use crate::extras::OptionExpect as _;
pub use crate::extras::QuickClone as _;
pub use crate::extras::QuickToOwned as _;
pub use crate::extras::QuickToString as _;
pub use crate::extras::RangeExt as _;
pub use crate::extras::ResultExpect as _;
pub use crate::extras::ResultIgnore as _;
Modules§
- future
- Asynchronous values.
- sink
- Asynchronous sinks.
- stream
- Asynchronous streams.
- vec
- A contiguous growable array type with heap-allocated contents, written
Vec<T>
.
Macros§
- A
- Construct an ad-hoc error from a string or existing non-
anyhow
error value. - anyhow
- Construct an ad-hoc error from a string or existing non-
anyhow
error value. - assert
- Asserts that a boolean expression is
true
at runtime. - bail
- Return early with an error.
- bug
- Like ‘unimplemented’ but shorter to type.
- cfg
- Evaluates boolean combinations of configuration flags at compile-time.
- cfg_if
- The main macro provided by this crate. See crate documentation for more information.
- column
- Expands to the column number at which it was invoked.
- compile_
error - Causes compilation to fail with the given error message when encountered.
- concat
- Concatenates literals into a static string slice.
- debug
- Logs a message at the debug level.
- env
- Inspects an environment variable at compile time.
- error
- Logs a message at the error level.
- file
- Expands to the file name in which it was invoked.
- fmt
- Creates a
String
using interpolation of runtime expressions. - format
- Creates a
String
using interpolation of runtime expressions. - format_
args - Constructs parameters for the other string-formatting macros.
- include
- Parses a file as an expression or an item according to the context.
- include_
bytes - Includes a file as a reference to a byte array.
- include_
str - Includes a UTF-8 encoded file as a string.
- info
- Logs a message at the info level.
- line
- Expands to the line number on which it was invoked.
- module_
path - Expands to a string that represents the current module path.
- option_
env - Optionally inspects an environment variable at compile time.
- stringify
- Stringifies its arguments.
- trace
- Logs a message at the trace level.
- vec
- Creates a
Vec
containing the arguments. - warn
- Logs a message at the warn level.
- concat_
bytes Experimental - Concatenates literals into a byte slice.
- concat_
idents Deprecated Experimental - Concatenates identifiers into one identifier.
- deref
Experimental - Unstable placeholder for deref patterns.
- format_
args_ nl Experimental - Same as
format_args
, but adds a newline in the end. - log_
syntax Experimental - Prints passed tokens into the standard output.
- trace_
macros Experimental - Enables or disables tracing functionality used for debugging other macros.
- type_
ascribe Experimental - Unstable placeholder for type ascription.
Structs§
- AnyError
- The
Error
type, a wrapper around a dynamic error type. - Box
- A pointer type that uniquely owns a heap allocation of type
T
. - String
- A UTF-8–encoded, growable string.
- Vec
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’.
Enums§
- Either
- Combines two different futures, streams, or sinks having the same associated types into a single type.
- Option
- The
Option
type. See the module level documentation for more. - Ordering
- An
Ordering
is the result of a comparison between two values. - Result
Result
is a type that represents either success (Ok
) or failure (Err
).
Traits§
- AsMut
- Used to do a cheap mutable-to-mutable reference conversion.
- AsRef
- Used to do a cheap reference-to-reference conversion.
- Async
BufRead - Read bytes asynchronously.
- AsyncFn
- An async-aware version of the
Fn
trait. - Async
FnMut - An async-aware version of the
FnMut
trait. - Async
FnOnce - An async-aware version of the
FnOnce
trait. - Async
Read - Read bytes asynchronously.
- Async
Seek - Seek bytes asynchronously.
- Async
Write - Write bytes asynchronously.
- Clone
- A common trait for the ability to explicitly duplicate an object.
- Copy
- Types whose values can be duplicated simply by copying bits.
- Default
- A trait for giving a type a useful default value.
- Double
Ended Iterator - An iterator able to yield elements from both ends.
- Drop
- Custom code within the destructor.
- Eq
- Trait for comparisons corresponding to equivalence relations.
- Exact
Size Iterator - An iterator that knows its exact length.
- Extend
- Extend a collection with the contents of an iterator.
- Fn
- The version of the call operator that takes an immutable receiver.
- FnMut
- The version of the call operator that takes a mutable receiver.
- FnOnce
- The version of the call operator that takes a by-value receiver.
- From
- Used to do value-to-value conversions while consuming the input value. It is the reciprocal of
Into
. - From
Iterator - Conversion from an
Iterator
. - Future
- A future represents an asynchronous computation obtained by use of
async
. - Into
- A value-to-value conversion that consumes the input value. The
opposite of
From
. - Into
Iterator - Conversion into an
Iterator
. - Iterator
- A trait for dealing with iterators.
- Ord
- Trait for types that form a total order.
- Partial
Eq - Trait for comparisons using the equality operator.
- Partial
Ord - Trait for types that form a partial order.
- Send
- Types that can be transferred across thread boundaries.
- Sink
- A
Sink
is a value into which other values can be sent, asynchronously. - Sized
- Types with a constant size known at compile time.
- Stream
- A stream of values produced asynchronously.
- Sync
- Types for which it is safe to share references between threads.
- ToOwned
- A generalization of
Clone
to borrowed data. - ToString
- A trait for converting a value to a
String
. - TryFrom
- Simple and safe type conversions that may fail in a controlled
way under some circumstances. It is the reciprocal of
TryInto
. - TryFuture
- A convenience for futures that return
Result
values that includes a variety of adapters tailored to such futures. - TryInto
- An attempted conversion that consumes
self
, which may or may not be expensive. - TryStream
- A convenience for streams that return
Result
values that includes a variety of adapters tailored to such futures. - Unpin
- Types that do not require any pinning guarantees.
- _
- An extension trait for
Future
s that provides a variety of convenient adapters.
Functions§
- align_
of - Returns the ABI-required minimum alignment of a type in bytes.
- align_
of_ val - Returns the ABI-required minimum alignment of the type of the value that
val
points to in bytes. - block_
on - Run a future to completion on the current thread.
- drop
- Disposes of a value.
- size_of
- Returns the size of a type in bytes.
- size_
of_ val - Returns the size of the pointed-to value in bytes.
Type Aliases§
- AnyResult
Result<T, Error>
Attribute Macros§
- derive
- Attribute macro used to apply derive macros.
- extension_
trait - Declares an extension trait
- global_
allocator - Attribute macro applied to a static to register it as a global allocator.
- test
- Attribute macro applied to a function to turn it into a unit test.
- alloc_
error_ handler Experimental - Attribute macro applied to a function to register it as a handler for allocation failure.
- bench
Experimental - Attribute macro applied to a function to turn it into a benchmark test.
- cfg_
accessible Experimental - Keeps the item it’s applied to if the passed path is accessible, and removes it otherwise.
- cfg_
eval Experimental - Expands all
#[cfg]
and#[cfg_attr]
attributes in the code fragment it’s applied to. - define_
opaque Experimental - Provide a list of type aliases and other opaque-type-containing type definitions to an item with a body. This list will be used in that body to define opaque types’ hidden types. Can only be applied to things that have bodies.
- derive_
const Experimental - Attribute macro used to apply derive macros for implementing traits in a const context.
- test_
case Experimental - An implementation detail of the
#[test]
and#[bench]
macros.
Derive Macros§
- Clone
- Derive macro generating an impl of the trait
Clone
. - Copy
- Derive macro generating an impl of the trait
Copy
. - Debug
- Derive macro generating an impl of the trait
Debug
. - Default
- Derive macro generating an impl of the trait
Default
. - Eq
- Derive macro generating an impl of the trait
Eq
. - Hash
- Derive macro generating an impl of the trait
Hash
. - Ord
- Derive macro generating an impl of the trait
Ord
. The behavior of this macro is described in detail here. - Partial
Eq - Derive macro generating an impl of the trait
PartialEq
. The behavior of this macro is described in detail here. - Partial
Ord - Derive macro generating an impl of the trait
PartialOrd
. The behavior of this macro is described in detail here.