Crate otter_nodejs_tests
source · [−]Expand description
Otter game system (part thereeof)
https://www.chiark.greenend.org.uk/~ianmdlvl/otter/docs/README.html
This crate is intended for use only by other parts of Otter.
Modules
async-condvar-fair
Configs
Provides the Boolinator
trait, which lets you use Option
and Result
-style combinators with bool
s.
This crate offers functionality for casting between trait objects using only
safe Rust and no platform specific code. If you want to downcast to concrete
types instead of other trait objects then this crate can’t help you, instead
use std::any
or a crate like downcast-rs
.
This crate removes some boilerplate for structs that simply delegate some of their methods to one or more of their fields.
A simple logger that can be configured via environment variables, for use
with the logging facade exposed by the log
crate.
Support for matching file paths against Unix shell style patterns.
Serde support for the humantime
crate.
This crate helps with defining “newtype”-style wrappers around usize
(or
other integers), Vec<T>
, and [T]
so that some additional type safety can
be gained at zero cost.
A crate for things that are
Use the regex! macro to build regexes:
Multi-producer, single-consumer FIFO queue communication primitives.
Overview
Wrappers for total order on Floats. See the OrderedFloat
and NotNan
docs for details.
This crate provides a library for parsing, compiling, and executing regular expressions. Its syntax is similar to Perl-style regular expressions, but lacks a few features like look around and backreferences. In exchange, all searches execute in linear time with respect to the size of the regular expression and search text.
Temporary files and directories.
Tera
Native threads.
A unix domain sockets library that supports abstract addresses, fd-passing, SOCK_SEQPACKET sockets and more.
deque (double-ended queue) with stable element indices
A library for reading and writing ZIP archives. ZIP is a format designed for cross-platform file “archiving”. That is, storing a collection of files in a single datastream to make them easier to share between computers. Additionally, ZIP is able to compress and encrypt files in its archives.
Macros
Derive macro generating an impl of the trait Debug
.
Derive macro generating an impl of the trait Hash
.
Construct an ad-hoc error from a string or existing non-anyhow
error
value.
Logs a message at the debug level.
Generate the boilerplate for a newtyped index struct, for use with
IndexVec
.
Inspects an environment variable at compile time.
Logs a message at the error level.
Macro for writing nested if let
expressions.
Adds downcasting support to traits that extend downcast::Downcast
by defining forwarding
methods to the corresponding implementations on std::any::Any
in the standard library.
A macro equivalent to the stdlib’s vec![]
, but producing an IndexVec
.
Logs a message at the info level.
Create an iterator over the “cartesian product” of iterators.
Create an iterator running multiple iterators in lockstep.
The standard logging macro.
Determines if a message logged at the specified level in that module will be logged.
Return a lazy static Regex checked at compilation time and built at first use.
Extract captured groups as a tuple of &str.
Allows the use of serde for a compat struct
Throw an error.
Logs a message at the trace level.
Logs a message at the warn level.
Structs
Record of acess for a player. Newtype prevents mutable access without invalidating old tokens and permissions check.
Sample a u8
, uniformly distributed over ASCII letters and numbers:
a-z, A-Z and 0-9.
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
A vector with a fixed capacity.
A boolean type which can be safely shared between threads.
An ordered set based on a B-Tree.
The BufReader<R>
struct adds buffering to any reader.
Wraps a writer and buffers its output.
Representation of a running or exited child process.
A process builder, providing fine-grained control over how a new process should be spawned.
0 = unrotated, +ve is anticlockwise, units of 45deg
Condition variable (for async)
Dense slot map, storage with stable unique keys.
A Duration
type to represent a span of time, typically used for system
timeouts.
An enum mapping.
A reference to an open file on the filesystem.
Configuration for formatting.
Strange ownership and serialisation rules, like OccultIlkOwningId
A hash table where the iteration order of the key-value pairs is independent of the hash values of the keys.
A hash set where the iteration order of the values is independent of their hash values.
A slice that only accepts indices of a specific type. Note that the intended
usage is as IndexSlice<I, [T]>
.
A Vec that only accepts indices of a specific type.
An IPv4 address.
An IPv6 address.
Immutable struct that defines which loglines are to be written, based on the module, the log level, and the text.
Proof token that it is OK to modify the array
A named temporary file.
An integer that is known not to equal zero.
Does not impl Drop
. Don’t just drop it.
A wrapper around floats providing implementations of Eq
, Ord
, and Hash
.
Zero-sized type used to mark things that “act like” they own a T
.
Special handling instructions for this piece
A compiled regular expression for matching Unicode strings.
An iterator over the variants of Self
Drop this only on errors; don’t just forget it
Proof token.
Sparse secondary map, associate data with previously stored elements in a slot map.
Double-ended queue with stable indices
An iterator over the variants of Self
The main point of interaction in this library.
The error type returned when a checked integral type conversion fails.
User identifier
Case Insensitive wrapper of strings.
A Unix stream socket.
A parsed URL record.
A double-ended queue implemented with a growable ring buffer.
Provides intentionally-wrapped arithmetic on T
.
Pieces on top have higher values than ones
A struct for reading a zip file
Enums
Defines big-endian serialization.
A clone-on-write smart pointer.
The enum Either
with variants Left
and Right
is a general purpose
sum type with two cases.
Value that either holds a single A or B, or both.
A list specifying general categories of I/O error.
Strange ownership and serialisation rules, like OccultIlkOwningId
The error type for errors that can never happen.
An IP address, either IPv4 or IPv6.
Defines little-endian serialization.
An Ordering
is the result of a comparison between two values.
An internet socket address, either IPv4 or IPv6.
The empty type for cases which can’t occur.
Error type for Zip
Constants
Everything that is not an ASCII letter or digit.
Fudge factor
The full circle constant (τ)
Traits
A trait to emulate dynamic typing.
A trait to extract the raw file descriptor from an underlying object.
A trait for borrowing data.
Numbers which have upper and lower bounds
A BufRead
is a type of Read
er which has an internal buffer, allowing it
to perform extra ways of reading.
Unix-specific extensions to the process::Command
builder.
Implements a compilation time default value for the implemented type.
An Eq
-like trait that produces a Choice
instead of a bool
.
Provides the context
method for Result
.
?
formatting.
Used for immutable dereferencing operations, like *v
.
Used for mutable dereferencing operations, like in *v = 1;
.
A data structure that can be deserialized from any data format supported by Serde.
A data structure that can be deserialized without borrowing any data from the deserializer.
A data format that can deserialize any data structure supported by Serde.
Convinience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
Format trait for an empty format, {}
.
Supports conversion to Any
. Traits to be extended by impl_downcast!
must extend Downcast
.
Simplifies the use of the DynCast
trait by abstracting away the difference
between different ways of storing trait objects.
Enum mapping type.
A trait for capturing the number of variants in Enum. This trait can be autoderived by
strum_macros
.
Associates additional pieces of information with an Enum. This can be
autoimplemented by deriving EnumMessage
and annotating your variants with
#[strum(message="...")]
.
EnumProperty
is a trait that makes it possible to store additional information
with enum variants. This trait is designed to be used with the macro of the same
name in the strum_macros
crate. Currently, the only string literals are supported
in attributes, the other methods will be implemented as additional attribute types
become stabilized.
Error
is a trait representing the basic expectations for error values,
i.e., values of type E
in Result<T, E>
.
Unix-specific extensions to process::ExitStatus
and
ExitStatusError
.
Extension trait for std::fs::File
which provides allocation, duplication and locking methods.
A generic trait for converting a number to a value.
Parse a value from a string
An iterator that always continues to yield None
when exhausted.
A hashable type.
A trait for hashing an arbitrary stream of bytes.
Used for indexing operations (container[index]
) in immutable contexts.
Used for indexing operations (container[index]
) in mutable contexts.
This trait designates that an Enum
can be iterated over. It can
be auto generated using strum_macros
on your behalf.
A trait to express the ability to consume an object and acquire ownership of its raw file descriptor.
Extension trait for slotmap::KeyData
, providing get_idx_version
.
Unix-specific extensions to fs::Metadata
.
Unix-specific extensions to fs::OpenOptions
.
Unix-specific extensions to fs::Permissions
.
The Read
trait allows for reading bytes from a source.
Extends Read
with methods for reading numbers. (For std::io
.)
Extensions to Result<Void, E>
Extensions to Result<T, Void>
An automatically-implemented extension trait on RngCore
providing high-level
generic methods for sampling values and other convenience methods.
A data structure that can be serialized into any data format supported by Serde.
Returned from Serializer::serialize_tuple
.
A data format that can serialize any data structure supported by Serde.
Extension trait on slices, providing random mutation and sampling methods.
Types that can be used as an index for a Deque.
A struct that is converted from command line arguments.
A generic trait for converting a value to a number.
A trait for objects which can be converted or resolved to one or more
SocketAddr
values.
Simple and safe type conversions that may fail in a controlled
way under some circumstances. It is the reciprocal of TryInto
.
An attempted conversion that consumes self
, which may or may not be
expensive.
A trait for objects which are byte-oriented sinks.
Extends Write
with methods for writing numbers. (For std::io
.)
A trait for writing or formatting into Unicode-accepting buffers or streams.
Extension trait for Option<Baton>
to provide dispose
and pass
This trait defines a number of combinator-style methods for use with bool
values.
OS-specific extensions to fs::Metadata
.
The Error
trait allows Deserialize
implementations to create descriptive
error messages belonging to the Deserializer
against which they are
currently running.
Key used to access stored values in a slot map.
A trait for writing or formatting into Unicode-accepting buffers or streams.
Functions
Prepare to set the z level of gpc to z
Cast from one machine scalar to another.
Create an iterator that first iterates i
and then j
.
Get the time of the specified clock, (see clock_gettime(2)).
Terminates the current process with the specified exit code.
Underlying extraction function. Fails rather than panicing.
Compares and returns the maximum of two values.
Compares and returns the minimum of two values.
Percent-decode the given string.
None => do not render at all
Creates a new iterator that repeats elements of type A
endlessly by
applying the provided closure, the repeater, F: FnMut() -> A
.
Puts the current thread to sleep for at least the specified amount of time.
Retrieve the lazily-initialized thread-local random number generator,
seeded by the system. Intended to be used in method chaining style,
e.g. thread_rng().gen::<i32>()
, or cached locally, e.g.
let mut rng = thread_rng();
. Invoked by the Default
trait, making
ThreadRng::default()
equivalent.
A safe version of intrinsincs::unreachable
.
Percent-encode the UTF-8 encoding of the given string.
Iterate i
and j
in lock step.
Type Definitions
A mutual exclusion primitive useful for protecting shared data
An RAII implementation of a “scoped lock” of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked.
A type alias for Infallible
.
Raw file descriptors.
A reader-writer lock
RAII structure used to release the shared read access of a lock when dropped.
RAII structure used to release the exclusive write access of a lock when dropped.
SHA-512 hasher.
SHA-512/256 hasher.
Attribute Macros
Annotating a trait or enum definition with an #[enum_dispatch]
attribute will register it
with the enum_dispatch library, allowing it to be used to generate impl blocks elsewhere.
See crate docs for more info.
Derive Macros
Converts enum variants to &'static str
.
Derives an implementation for the ConstDefault
trait.
Deserialize value by using its FromStr
implementation
Derive macro generating an implementation of trait Enum
.
Add a constant usize
equal to the number of variants.
Generate a new type with only the discriminant names.
Creates a new type that iterates of the variants of an enum.
Add a verbose message to an enum variant.
Add custom properties to enum variants.
Converts strings to enum variants based on their name.
Derives num_traits::FromPrimitive
for simple enums and newtypes.
Implements From<MyEnum> for &'static str
on an enum.
Serialize value by using it’s Display
implementation
Generates the StructOpt
impl.
Derives num_traits::ToPrimitive
for simple enums and newtypes.