12 unstable releases (3 breaking)
|new 0.4.3||Oct 10, 2021|
|0.4.1||Jul 20, 2021|
|0.2.0||Mar 22, 2021|
|0.1.0||Oct 9, 2020|
#118 in Rust patterns
740 downloads per month
Used in 3 crates
This library contains a collection of well-tested utilities. Most modules stand alone, but taking a few representative examples:
gazebo::prelude::*is intended to be imported as such, and provides extension traits to common types. For example, it provides
Vec::mapwhich is equivalent to
splitbut which only splits once. We hope some of these functions one day make it into the Rust standard library.
gazebo::dupeprovides the trait
Dupewith the member
dupe, all of which are exactly like
Clone. The difference is that
Dupeshould not be implemented for types that reallocate or have expensive
cloneoperations - e.g. there is
usize, but not for
Vec. By using
dupeit is easy to focus on the
clonecalls (which should be rare) and ignore things whose cost is minimal.
gazebo::cell::ARefprovides a type which is either a
Ref<T>or a direct reference
&T, with operations that make it look like
Ref-- allowing you to uniformly convert a reference into something like a
gazebo::any::AnyLifetimeprovides a trait like
Any, but which does not require
'staticlifetimes, at the cost of more boilerplate.
The functionality provided by Gazebo is not stable, and continues to evolve with both additions (as we find new useful features) and removals (as we find better patterns or libraries encapsulating the ideas better). While the code varies in usefulness and design quality, it is all well tested and documented.
Gazebo can be depended upon by adding
gazebo to your
[dependencies], using the standard Cargo patterns.
The two interesting directories in this repo are
gazebo (which contains the source to Gazebo itself) and
gazebo_derive (which contains support for
#[derive(Dupe)] and other Gazebo traits). Usually you will directly import
gazebo_derive is a required transitive dependency if you are sourcing the library from GitHub.
- Check the GitHub Actions are green.
CHANGELOG.mdwith the changes since the last release. This link can help (update to compare against the last release).
- Update the version numbers of the two
Cargo.tomlfiles. Bump them by 0.0.1 if there are no incompatible changes, or 0.1.0 if there are. Bump the dependency in
gazeboto point at the latest
- Copy the files
CHANGELOG.md, the two
cargo publish --dry-run --allow-dirty, then without the
--dry-run, first in
- Create a GitHub release with
v0.X.Y, using the
gazeboversion as the name.