Expand description
Common utilities that aren’t specific to one other subcrate and are unlikely to change frequently. The main purpose of this is to pull logic out of the core crate, because that one changes a lot and requires constant recompilation.
This crate is not semver compliant. The version is locked to the root
slumber crate version. If you choose to depend directly on this crate, you
do so at your own risk of breakage.
Modules§
- paths
- yaml
- Utilities for deserializing YAML. This does not use serde, and instead relies on saphyr for YAML parsing and hand-written deserialization. This allows us to provide much better error messages, and also enables source span tracking.
Macros§
- deserialize_
enum - Deserialize a YAML value as an internally tagged enum. The
typefield will contain the variant, and all other fields in the mapping will be deserialized using the given function. - impl_
deserialize_ from - Implement DeserializeYaml for a type
Tvia typeU, whereT: From<U>, U: DeserializeYaml
Structs§
- Mapping
- A static mapping between values (of type
T) and labels (strings). Used to both stringify from and parse toT. - Time
Span - A newtype for Duration that provides formatting, parsing, and deserialization. The name is meant to make it harder to confuse with Duration.
- Time
Span Parse Error - Error for TimeSpan’s
FromStrimpl
Constants§
- NEW_
ISSUE_ LINK - Link to the GitHub New Issue form
Traits§
- Option
Ext - Extension trait for Option
- Result
Traced - Extension trait for Result
- Result
Traced Anyhow - ResultTraced but for the
anyhowresult. This has to be a separate trait because we can’t put a blanket impl on stdErrorandanyhow::Result, as the two “could” conflict in the future.
Functions§
- doc_
link - Get a link to a page on the doc website. This will append the doc prefix, as well as the suffix.
- git_
link - Get a link to a file in the remote git repo. This is the raw link, not the fancy UI link. It will be pinned to tag of the current crate version.
- initialize_
tracing - Set up tracing to a log file, and optionally stderr as well. If there’s an error creating the log file, we’ll skip that part. This means in the TUI the error (and all other tracing) will never be visible, but that’s a problem for another day.
- serialize_
mapping - Serialize a list of tuples as a mapping