[][src]Struct janus_plugin::jansson::JanssonValue

pub struct JanssonValue { /* fields omitted */ }

A safe wrapper for a Jansson JSON value. Automatically increases and decreases the refcount of the underlying value when cloned/dropped.

Implementations

impl JanssonValue[src]

pub unsafe fn from_and_incref(ptr: *mut RawJanssonValue) -> Option<Self>[src]

Creates a JanssonValue owning the given raw pointer, incrementing the reference count.

pub unsafe fn from_raw(ptr: *mut RawJanssonValue) -> Option<Self>[src]

Creates a JanssonValue owning the given raw pointer. Does not increment the reference count, but the JanssonValue's destructor will decrement the reference count.

pub fn into_raw(self) -> *mut RawJanssonValue[src]

Transfers ownership of this value to this pointer. The consumer of the pointer is responsible for calling json_decref on it later.

pub fn as_mut_ref(&mut self) -> &mut RawJanssonValue[src]

Gets the reference backing this value without taking ownership.

pub fn from_str(
    input: &str,
    decoding_flags: JanssonDecodingFlags
) -> Result<Self, Box<dyn Error + Send + Sync>>
[src]

Decodes a JSON string slice into a Jansson value, returning an error if decoding fails.

pub fn from_cstr(
    input: &CStr,
    decoding_flags: JanssonDecodingFlags
) -> Result<Self, Box<dyn Error + Send + Sync>>
[src]

Decodes a JSON C-style string into a Jansson value, returning an error if decoding fails.

pub fn to_libcstring(&self, encoding_flags: JanssonEncodingFlags) -> LibcString[src]

Encodes this Jansson value as a JSON owned C-style string.

Trait Implementations

impl Clone for JanssonValue[src]

impl Debug for JanssonValue[src]

impl Deref for JanssonValue[src]

type Target = RawJanssonValue

The resulting type after dereferencing.

impl Drop for JanssonValue[src]

impl Send for JanssonValue[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.