new

Function new 

Source
pub fn new() -> DefaultContext<System, NoTrace, Ignore>
Expand description

Construct a new default context using the System allocator.

ยงExamples

use musli::context;

musli::alloc::default(|alloc| {
    let cx = context::new();
    let encoding = musli::json::Encoding::new();
    let string = encoding.to_string_with(&cx, &42)?;
    assert_eq!(string, "42");
    Ok(())
})?;