pub fn collect(v: impl Value) -> Self {
        // Try get a primitive first
        // If the value is a simple primitive that can
        // be represented in a single token then we can avoid
        // allocating for it.
        if let Some(primitive) = PrimitiveBuf::collect(&v) {
            return OwnedValue(ValueInner::Primitive(primitive));
        }

        TokenBuf::collect(v)
            .map(|tokens| OwnedValue(ValueInner::Stream(tokens.into())))
            .unwrap_or_else(|err| OwnedValue(ValueInner::Error(err.to_string().into())))
    }
/**
    Get an owned value from an arbitrary [`Value`].

    The given value doesn't need to be `Send + Sync + 'static`.

    Some primitive types can be converted into an `OwnedValue`
    for free. These types have a corresponding `From` implementation.

    The structure of the given value will be streamed into
    a sharable representation. That means this method is more
    expensive for more complex values.

    Prefer the `From` impls and `from_shared` method where possible.

    [`Value`]: struct.Value.html
    */
Get an owned value from an arbitrary [`Value`].
The given value doesn't need to be `Send + Sync + 'static`.

Some primitive types can be converted into an `OwnedValue`
for free. These types have a corresponding `From` implementation.

The structure of the given value will be streamed into
a sharable representation. That means this method is more
expensive for more complex values.

Prefer the `From` impls and `from_shared` method where possible.


Get an owned value from an arbitrary [ ` Value ` ] . The given value doesn ' t need to be ` Send + Sync + ' static ` . Some primitive types can be converted into an ` OwnedValue ` for free . These types have a corresponding ` From ` implementation . The structure of the given value will be streamed into a sharable representation . That means this method is more expensive for more complex values . Prefer the ` From ` impls and ` from_shared ` method where possible .
pub fn collect(v: impl Value) -> Self {
        // Try get a primitive first
        // If the value is a simple primitive that can
        // be represented in a single token then we can avoid
        // allocating for it.
        if let Some(primitive) = PrimitiveBuf::collect(&v) {
            return OwnedValue(ValueInner::Primitive(primitive));
        }
        TokenBuf::collect(v)
            .map(|tokens| OwnedValue(ValueInner::Stream(tokens.into())))
            .unwrap_or_else(|err| OwnedValue(ValueInner::Error(err.to_string().into())))
    }
pub fn collect ( v : impl Value ) -> Self { // Try get a primitive first // If the value is a simple primitive that can // be represented in a single token then we can avoid // allocating for it. if let Some ( primitive ) = PrimitiveBuf :: collect ( & v ) { return OwnedValue ( ValueInner :: Primitive ( primitive ) ) ; } TokenBuf :: collect ( v ) . map ( | tokens | OwnedValue ( ValueInner :: Stream ( tokens . into ( ) ) ) ) . unwrap_or_else ( | err | OwnedValue ( ValueInner :: Error ( err . to_string ( ) . into ( ) ) ) ) }
Get an owned value from an arbitrary [`Value`].
Get an owned value from an arbitrary [ ` Value ` ] .
v
impl Value