Crate ergo

Source
Expand description

Make rust’s ecosystem more ergonomic, therefore more fun!

This crate is in alpha status, please see the github project for more details

https://github.com/rust-crates/ergo

Re-exports§

pub extern crate ergo_config;
pub extern crate ergo_fs;
pub extern crate ergo_std;
pub extern crate ergo_sync;
pub extern crate ergo_sys;

Modules§

ch
Module for working with channels. Rexport of crossbeam_channel
configure
Configuration management.
crossbeam_channel
Multi-producer multi-consumer channels for message passing.
ctrlc
Cross platform handling of Ctrl-C signals.
f32
Constants for the f32 single-precision floating point type.
f64
Constants for the f64 double-precision floating point type.
glob_crate
Support for matching file paths against Unix shell style patterns.
i8Deprecation planned
Redundant constants module for the i8 primitive type.
i16Deprecation planned
Redundant constants module for the i16 primitive type.
i64Deprecation planned
Redundant constants module for the i64 primitive type.
indexmap
IndexMap is a hash table where the iteration order of the key-value pairs is independent of the hash values of the keys.
isizeDeprecation planned
Redundant constants module for the isize primitive type.
itertools
Itertools — extra iterator adaptors, functions and macros.
json
Serde JSON
lazy_static
A macro for declaring lazily evaluated statics.
maplit
Macros for container literals with specific type.
num_cpus
A crate with utilities to determine the number of CPUs available on the current system.
path_abs
Ergonomic paths and files in rust.
rand
Utilities for random number generation
regex
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.
serde
Serde
serde_derive
This crate provides Serde’s two derive macros.
shellexpand
Provides functions for performing shell-like expansions in strings.
std_prelude
use std_prelude::* so you can be ready to code!
str
Utilities for the str primitive type.
tar
A library for reading and writing TAR archives
tempdir
Temporary directories of files.
toml
A TOML-parsing library
u8Deprecation planned
Redundant constants module for the u8 primitive type.
u16Deprecation planned
Redundant constants module for the u16 primitive type.
u64Deprecation planned
Redundant constants module for the u64 primitive type.
usizeDeprecation planned
Redundant constants module for the usize primitive type.
walkdir
Crate walkdir provides an efficient and cross platform implementation of recursive directory traversal. Several options are exposed to control iteration, such as whether to follow symbolic links (default off), limit the maximum number of simultaneous open file descriptors and the ability to efficiently skip descending into directories.
yaml
This crate is a Rust library for using the Serde serialization framework with data in YAML file format.

Macros§

btreemap
Create a BTreeMap from a list of key-value pairs
btreeset
Create a BTreeSet from a list of elements.
ch
Use with channels with ergonomic syntax and panic with helpful error messages when sending/receiving on a channel is invalid.
ch_try
Handle an expression that could be Err and send it over a channel if it is.
convert_args
Macro that converts the keys or key-value pairs passed to another maplit macro. The default conversion is to use the Into trait, if no custom conversion is passed.
forward_to_deserialize_any
Helper macro when implementing the Deserializer part of a new data format for Serde.
hashmap
Create a HashMap from a list of key-value pairs
hashset
Create a HashSet from a list of elements.
indexmap
Create an IndexMap from a list of key-value pairs
indexset
Create an IndexSet from a list of values
lazy_static
select_loop
The static selection macro.
take
Take ownership of specific variables.
use_config_from
use_default_config

Structs§

Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
AtomicBool
A boolean type which can be safely shared between threads.
AtomicIsize
An integer type which can be safely shared between threads.
AtomicUsize
An integer type which can be safely shared between threads.
BTreeMap
An ordered map based on a B-Tree.
BufReader
The BufReader<R> struct adds buffering to any reader.
BufWriter
Wraps a writer and buffers its output.
DeserializeError
Error when a Serializer or Deserializer trait object fails.
Duration
A Duration type to represent a span of time, typically used for system timeouts.
File
An object providing access to an open file on the filesystem.
FileEdit
A read/write file handle with path() attached and improved error messages. Contains methods and trait implements for both readable and writeable files.
FileRead
A read-only file handle with path() attached and improved error messages. Contains only the methods and trait implementations which are allowed by a read-only file.
FileWrite
A write-only file handle with path() attached and improved error messages. Contains only the methods and trait implementations which are allowed by a write-only file.
GlobPathDirs
Returns an iterator of only PathDirss, any files that matched the glob are ignored.
GlobPathFiles
Returns an iterator of only PathFiles, any directories that matched the glob are ignored.
GlobPathTypes
An iterator that yields PathTypes from the filesystem that match a particular pattern.
HashMap
A hash map implemented with quadratic probing and SIMD lookup.
HashSet
A hash set implemented as a HashMap where the value is ().
IndexMap
A hash table where the iteration order of the key-value pairs is independent of the hash values of the keys.
IndexSet
A hash set where the iteration order of the values is independent of their hash values.
IntoIter
An owning iterator that waits for messages until the channel is disconnected.
Iter
An iterator that waits for messages until the channel is disconnected.
Mutex
A mutual exclusion primitive useful for protecting shared data
OpenOptions
Options and flags which can be used to configure how a file is opened.
OsString
A type that can represent owned, mutable platform-native strings, but is cheaply inter-convertible with Rust strings.
Path
A slice of a path (akin to str).
PathAbs
An absolute (not necessarily canonicalized) path that may or may not exist.
PathArc
A PathBuf that is atomically reference counted and reimplements the PathBuf methods to display the action and path when there is an error.
PathBuf
An owned, mutable path (akin to String).
PathDir
A PathAbs that is guaranteed to be a directory, with associated methods.
PathFile
a PathAbs that was a file at the time of initialization, with associated methods.
PathTmp
A PathDir that is automatically deleted when it goes out of scope.
Rc
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’.
ReadDir
Iterator over the entries in a directory.
Receiver
The receiving half of a channel.
RecvError
An error returned from the Receiver::recv method.
Regex
A compiled regular expression for matching Unicode strings.
Select
The dynamic selection interface.
SelectRecvError
An error returned from the Select::recv method.
SelectSendError
An error returned from the Select::send method.
SendError
An error returned from the Sender::send method.
Sender
The sending half of a channel.
TryIter
An iterator that receives messages until the channel is empty or disconnected.
WalkDir
A builder to create an iterator for recursively walking a directory.
WalkError
An error produced by recursively walking a directory.

Enums§

AtomicOrdering
Atomic memory orderings
Cow
A clone-on-write smart pointer.
Ordering
An Ordering is the result of a comparison between two values.
PathType
An an enum containing either a file or a directory.
RecvTimeoutError
This enumeration is the list of possible errors that made recv_timeout unable to return data when called. This can occur with both bounded and unbounded channels.
SeekFrom
Enumeration of possible methods to seek within an I/O object.
SendTimeoutError
This enumeration is the list of possible errors that made send_timeout unable to return data when called. This can occur with bounded channels only.
TryRecvError
This enumeration is the list of the possible reasons that try_recv could not return data when called. This can occur with both bounded and unbounded channels.
TrySendError
This enumeration is the list of the possible error outcomes for the try_send method.

Constants§

ATOMIC_USIZE_INITDeprecated
An AtomicUsize initialized to 0.

Traits§

AsciiExtDeprecated
Extension methods for ASCII-subset only operations.
Borrow
A trait for borrowing data.
BufRead
A BufRead is a type of Reader which has an internal buffer, allowing it to perform extra ways of reading.
Configure
A configuration struct which can be generated from the environment.
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.
Equivalent
Key equivalence trait.
FinishHandle
Convinience trait mimicking std::thread::JoinHandle with better ergonomics.
FmtWrite
A trait for writing or formatting into Unicode-accepting buffers or streams.
FromIterator
Conversion from an Iterator.
FromStr
Parse a value from a string
Hash
A hashable type.
Hasher
A trait for hashing an arbitrary stream of bytes.
IoWrite
A trait for objects which are byte-oriented sinks.
Itertools
The trait Itertools: extra iterator adaptors and methods for iterators.
LazyStatic
Support trait for enabling a few common operation on lazy static values.
Ord
Trait for types that form a total order.
PartialOrd
Trait for types that form a partial order.
PathDirExt
Extension method on the Path type.
PathTypeExt
Extended methods for PathType
Read
The Read trait allows for reading bytes from a source.
Seek
The Seek trait provides a cursor which can be moved within a stream of bytes.
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.
__Deref
Used for immutable dereferencing operations, like *v.

Functions§

bounded
Creates a new channel of bounded capacity, returning the sender/receiver halves.
deep_copy
Do a deep copy of a directory from one location to another.
expand
Performs both tilde and environment shell expansions in the default system context. This is the same as shellexpand::full and is the “typical use case” for expanding strings.
glob
Return an iterator that produces all the PathTypes that match the given pattern, which may be absolute or relative to the current working directory.
glob_with
The same as glob but with additional options.
initialize
Takes a shared reference to a lazy static and initializes it if it has not been already.
size_of
Returns the size of a type in bytes.
size_of_val
Returns the size of the pointed-to value in bytes.
sleep
Puts the current thread to sleep for at least the specified amount of time.
sleep_ms
Just sleep for a certain number of milliseconds.
spawn
Spawns a new thread, returning a JoinHandle for it.
unbounded
Creates a new channel of unbounded capacity, returning the sender/receiver halves.

Type Aliases§

ExpandError
Renamed shellexpand::LookupError for better ergonomics.
GlobOptions
Renamed glob::MatchOptions
GlobPatternError
Renamed glob::PatternError

Derive Macros§

Configure
Debug
Derive macro generating an impl of the trait Debug.
Deserialize
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.
PartialOrd
Derive macro generating an impl of the trait PartialOrd. The behavior of this macro is described in detail here.
Serialize