Debian Codegraph @

/

debian rust-yoke 0.8.3-1debian librust-yoke-dev debian librust-yoke+alloc-dev debian librust-yoke+default-dev debian librust-yoke+derive-dev debian librust-yoke+serde-dev debian librust-yoke+zerofrom-dev debian librust-yoke-0-dev debian librust-yoke-0+alloc-dev debian librust-yoke-0+default-dev debian librust-yoke-0+derive-dev debian librust-yoke-0+serde-dev debian librust-yoke-0+zerofrom-dev debian librust-yoke-0.8-dev debian librust-yoke-0.8+alloc-dev debian librust-yoke-0.8+default-dev debian librust-yoke-0.8+derive-dev debian librust-yoke-0.8+serde-dev debian librust-yoke-0.8+zerofrom-dev debian librust-yoke-0.8.3-dev
6 more… debian librust-yoke-0.8.3+alloc-dev debian librust-yoke-0.8.3+default-dev debian librust-yoke-0.8.3+derive-dev debian librust-yoke-0.8.3+serde-dev debian librust-yoke-0.8.3+zerofrom-dev cargo yoke 0.8.3
debianjsonmakefilemarkdownrustrust-c-abishelltoml 26 files · 468 symbols
View dependency graph

Depends on

  • dh-cargo (dh-sequence-cargo)
  • rust-stable-deref-trait (librust-stable-deref-trait-1+alloc-dev, librust-stable-deref-trait-1-dev)
  • cargo, debhelper-compat, librust-yoke-derive-0.8-dev, librust-zerofrom-0.1+alloc-dev, librust-zerofrom-0.1+derive-dev, librust-zerofrom-0.1-dev, libstd-rust-dev, rustc
README (full)

yoke crates.io

This crate provides [Yoke<Y, C>][Yoke], which allows one to "yoke" (attach) a zero-copy deserialized object (say, a Cow<'a, str>) to the source it was deserialized from, (say, an Rc<[u8]>), known in this crate as a "cart", producing a type that looks like Yoke<Cow<'static, str>, Rc<[u8]>> and can be moved around with impunity.

Succinctly, this allows one to "erase" static lifetimes and turn them into dynamic ones, similarly to how dyn allows one to "erase" static types and turn them into dynamic ones.

Most of the time the yokeable Y type will be some kind of zero-copy deserializable abstraction, potentially with an owned variant (like Cow, ZeroVec, or an aggregate containing such types), and the cart C will be some smart pointer like Box<T>, Rc<T>, or Arc<T>, potentially wrapped in an Option<T>.

The key behind this crate is [Yoke::get()], where calling [.get()][Yoke::get] on a type like Yoke<Cow<'static, str>, _> will get you a short-lived &'a Cow<'a, str>, restricted to the lifetime of the borrow used during .get(). This is entirely safe since the Cow borrows from the cart type C, which cannot be interfered with as long as the Yoke is borrowed by .get(). .get() protects access by essentially reifying the erased lifetime to a safe local one when necessary.

See the documentation of [Yoke] for more details.

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.

dir debian/
dir src/
dir tests/
file .cargo_vcs_info.json
file Cargo.lock
file Cargo.toml
file Cargo.toml.orig
file LICENSE
file README.md