[][src]Module af_lib::prelude

A “prelude” module containing common imports.

Modules

af_core

Macros

Debug

Derive macro generating an impl of the trait Debug.

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.

PartialEq

Derive macro generating an impl of the trait PartialEq.

PartialOrd

Derive macro generating an impl of the trait PartialOrd.

attempt

Runs a block of code and catches ? operator returns.

attempt_async

Runs a block of async code and catches ? operator returns.

cfg_if

The main macro provided by this crate. See crate documentation for more information.

debug

Logs a message at the debug level.

error

Logs a message at the error level.

fail

Returns an Err containing a new fail::Error from format args.

info

Logs a message at the info level.

panic

Panics the current thread.

pin

Pins a variable of type T on the stack and rebinds it as Pin<&mut T>.

trace

Logs a message at the trace level.

warn

Logs a message at the warn level.

Structs

Arc

A thread-safe reference-counting pointer. 'Arc' stands for 'Atomically Reference Counted'.

ArcWeak

Weak is a version of Arc that holds a non-owning reference to the managed allocation. The allocation is accessed by calling upgrade on the Weak pointer, which returns an Option<Arc<T>>.

Cell

A mutable memory location.

Date
Duration

A duration of time.

Lazy

A value which is initialized on the first access.

ManuallyDrop

A wrapper to inhibit compiler from automatically calling T’s destructor. This wrapper is 0-cost.

Panic

An error representing a panic.

PhantomData

Zero-sized type used to mark things that "act like" they own a T.

Pin

A pinned pointer.

Range

A (half-open) range bounded inclusively below and exclusively above (start..end).

RangeFrom

A range only bounded inclusively below (start..).

RangeFull

An unbounded range (..).

RangeInclusive

A range bounded inclusively below and above (start..=end).

RangeTo

A range only bounded exclusively above (..end).

RangeToInclusive

A range only bounded inclusively above (..=end).

Rc

A single-threaded reference-counting pointer. 'Rc' stands for 'Reference Counted'.

RcWeak

Weak is a version of Rc that holds a non-owning reference to the managed allocation. The allocation is accessed by calling upgrade on the Weak pointer, which returns an Option<Rc<T>>.

RefCell

A mutable memory location with dynamically checked borrow rules

Time

A timestamp with a time zone.

Uuid

A universally-unique identifier.

Enums

ControlFlowExperimental

Used to make try_fold closures more like normal loops

GeneratorStateExperimental

The result of a generator resumption.

Bound

An endpoint of a range of keys.

Cow

A clone-on-write smart pointer.

Infallible

The error type for errors that can never happen.

Traits

CoerceUnsizedExperimental

Trait that indicates that this is a pointer or a wrapper for one, where unsizing can be performed on the pointee.

DispatchFromDynExperimental

This is used for object safety, to check that a method's receiver type can be dispatched on.

GeneratorExperimental

The trait implemented by builtin generator types.

TryExperimental

A trait for customizing the behavior of the ? operator.

Add

The addition operator +.

AddAssign

The addition assignment operator +=.

Any

A trait to emulate dynamic typing.

BitAnd

The bitwise AND operator &.

BitAndAssign

The bitwise AND assignment operator &=.

BitOr

The bitwise OR operator |.

BitOrAssign

The bitwise OR assignment operator |=.

BitXor

The bitwise XOR operator ^.

BitXorAssign

The bitwise XOR assignment operator ^=.

Borrow

A trait for borrowing data.

BorrowMut

A trait for mutably borrowing data.

Debug

? formatting.

Deref

Used for immutable dereferencing operations, like *v.

DerefMut

Used for mutable dereferencing operations, like in *v = 1;.

Deserialize

A data structure that can be deserialized from any data format supported by Serde.

Deserializer

A data format that can deserialize any data structure supported by Serde.

Display

Format trait for an empty format, {}.

Div

The division operator /.

DivAssign

The division assignment operator /=.

Drop

Custom code within the destructor.

Eq

Trait for equality comparisons which are equivalence relations.

Error

Error is a trait representing the basic expectations for error values, i.e., values of type E in Result<T, E>. Errors must describe themselves through the Display and Debug traits, and may provide cause chain information:

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.

FromStr

Parse a value from a string

Future

A future represents an asynchronous computation.

Hash

A hashable type.

Hasher

A trait for hashing an arbitrary stream of bytes.

Index

Used for indexing operations (container[index]) in immutable contexts.

IndexMut

Used for indexing operations (container[index]) in mutable contexts.

Mul

The multiplication operator *.

MulAssign

The multiplication assignment operator *=.

Neg

The unary negation operator -.

Not

The unary logical negation operator !.

Number

A trait for types that implement all the basic operations of a number.

Ord

Trait for types that form a total order.

PartialEq

Trait for equality comparisons which are partial equivalence relations.

PartialOrd

Trait for values that can be compared for a sort-order.

Random

A trait for types that can be created randomly.

RangeBounds

RangeBounds is implemented by Rust's built-in range types, produced by range syntax like .., a.., ..b, ..=c, d..e, or f..=g.

Rem

The remainder operator %.

RemAssign

The remainder assignment operator %=.

Serialize

A data structure that can be serialized into any data format supported by Serde.

Serializer

A data format that can serialize any data structure supported by Serde.

Shl

The left shift operator <<. Note that because this trait is implemented for all integer types with multiple right-hand-side types, Rust's type checker has special handling for _ << _, setting the result type for integer operations to the type of the left-hand-side operand. This means that though a << b and a.shl(b) are one and the same from an evaluation standpoint, they are different when it comes to type inference.

ShlAssign

The left shift assignment operator <<=.

Shr

The right shift operator >>. Note that because this trait is implemented for all integer types with multiple right-hand-side types, Rust's type checker has special handling for _ >> _, setting the result type for integer operations to the type of the left-hand-side operand. This means that though a >> b and a.shr(b) are one and the same from an evaluation standpoint, they are different when it comes to type inference.

ShrAssign

The right shift assignment operator >>=.

Stream

A stream of values produced asynchronously.

StreamExt

Extension trait for Stream.

Sub

The subtraction operator -.

SubAssign

The subtraction assignment operator -=.

ToOwned

A generalization of Clone to borrowed data.

TryFrom

Simple and safe type conversions that may fail in a controlled way under some circumstances. It is the reciprocal of TryInto.

TryFuture

A Future that returns a result.

TryInto

An attempted conversion that consumes self, which may or may not be expensive.

_

A trait for writing or formatting into Unicode-accepting buffers or streams.

_

Extension methods for futures that return a result.

_

An Iterator blanket implementation that provides extra adaptors and methods.

_

An extension trait for f32 and f64.

_

A BufRead is a type of Reader which has an internal buffer, allowing it to perform extra ways of reading.

_

The Read trait allows for reading bytes from a source.

_

The Seek trait provides a cursor which can be moved within a stream of bytes.

_

A trait for objects which are byte-oriented sinks.

Functions

default

Returns the “default value” for a type.

random

Generates a random value.

Type Definitions

Result

Represents either success (Ok) or failure (Err).

Attribute Macros

pin_project

An attribute that creates projection types covering all the fields of struct or enum.

Derive Macros

Deserialize
Error
Serialize