serde-bridge

Crates.ioserde-bridge
lib.rsserde-bridge
version0.0.3
sourcesrc
created_at2022-04-15 10:04:25.563211
updated_at2022-04-23 08:01:06.487044
descriptionBridge between serde types
homepage
repositoryhttps://github.com/Xuanwo/serde-bridge
max_upload_size
id568379
size74,643
Xuanwo (Xuanwo)

documentation

https://docs.rs/serde-bridge

README

serde-bridge   Build Status Latest Version

Bridge between serde types

Quick Start

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(())
}

Contributing

Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.

Getting help

Submit issues for bug report or asking questions in discussion.

Acknowledgment

This project is highly inspired by serde-value

License

Licensed under Apache License, Version 2.0.
Commit count: 19

cargo fmt