tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 583HTML 275Markdown 8TOML 41586 Definiciones

⎇ float-layout src/util/mod.rs Rust · 29 líneas · 784 B Historia Quién tocó qué crudo

CSS Grid: named lines and areas (#840) c3e80008d · Nico Burns ·

1//! Helpful misc. utilities such as a function to debug print a tree
2mod math;
3mod resolve;
4pub(crate) mod sys;
5
6pub use math::MaybeMath;
7pub use resolve::{MaybeResolve, ResolveOrZero};
8
9#[doc(hidden)]
10#[macro_use]
11pub(crate) mod debug;
12
13#[cfg(feature = "std")]
14mod print;
15#[cfg(feature = "std")]
16pub use print::print_tree;
17
18/// Deserialize a type `S` by deserializing a string, then using the `FromStr`
19/// impl of `S` to create the result. The generic type `S` is not required to
20/// implement `Deserialize`.
21#[cfg(feature = "serde")]
22pub(crate) fn deserialize_from_str<'de, S, D>(deserializer: D) -> Result<S, D::Error>
23where
24    S: for<'a> From<&'a str>,
25    D: serde::Deserializer<'de>,
26{
27    let s: String = serde::Deserialize::deserialize(deserializer)?;
28    Ok(S::from(&s))
29}