Crates.io | serde-bridge |
lib.rs | serde-bridge |
version | |
source | src |
created_at | 2022-04-15 10:04:25.563211+00 |
updated_at | 2025-02-18 10:42:32.902639+00 |
description | Bridge between serde types |
homepage | |
repository | https://github.com/Xuanwo/serde-bridge |
max_upload_size | |
id | 568379 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Bridge between serde types
use anyhow::Result;
use serde_bridge::{from_value, into_value, FromValue, IntoValue, Value};
fn main() -> Result<()> {
let v = bool::from_value(Value::Bool(true))?;
assert!(v);
let v: bool = from_value(Value::Bool(true))?;
assert!(v);
let v = true.into_value()?;
assert_eq!(v, Value::Bool(true));
let v = into_value(true)?;
assert_eq!(v, Value::Bool(true));
Ok(())
}
Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.
Submit issues for bug report or asking questions in discussion.
This project is highly inspired by serde-value