serde_magnus 0.8.0

Serde integration for Magnus
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::error::Error;
use magnus::{IntoValue, RHash, Value};

pub fn nest<Data>(variant: &'static str, data: Data) -> Result<Value, Error>
where
    Data: IntoValue,
{
    let hash = RHash::new();
    hash.aset(variant, data)?;
    Ok(hash.into_value())
}