Skip to main content

CTConfig

Struct CTConfig 

Source
pub struct CTConfig<const COMMA: bool = true, const TRAILING_COMMA: bool = false, const COMMENTS: bool = false>;
Expand description

Compile-time configuration for JSON parsing behavior.

Implementations§

Source§

impl<const A: bool, const B: bool> CTConfig<true, A, B>

Source

pub fn optional_comma(self) -> CTConfig<false, true, B>

Available on crate feature comment only.

Makes commas optional. As a side effect trailing commas are allowed automatically.

Source§

impl<const A: bool, const B: bool> CTConfig<A, false, B>

Source

pub fn allow_trailing_comma(self) -> CTConfig<A, true, B>

Available on crate feature comment only.

Allows trailing commas when parsing.

Source§

impl CTConfig

Source

pub fn new() -> Self

Creates a compile-time configuration with default settings.

By default, commas are required and both trailing commas and comments are not allowed.

Source§

impl<const A: bool, const B: bool> CTConfig<A, B>

Source

pub fn allow_comments(self) -> CTConfig<A, B, true>

Available on crate feature comment only.

Allows comments when parsing.

Trait Implementations§

Source§

impl<const COMMA: bool, const TRAILING_COMMA: bool, const COMMENTS: bool> Config for CTConfig<COMMA, TRAILING_COMMA, COMMENTS>

Available on crate feature comment only.

Auto Trait Implementations§

§

impl<const COMMA: bool, const TRAILING_COMMA: bool, const COMMENTS: bool> Freeze for CTConfig<COMMA, TRAILING_COMMA, COMMENTS>

§

impl<const COMMA: bool, const TRAILING_COMMA: bool, const COMMENTS: bool> RefUnwindSafe for CTConfig<COMMA, TRAILING_COMMA, COMMENTS>

§

impl<const COMMA: bool, const TRAILING_COMMA: bool, const COMMENTS: bool> Send for CTConfig<COMMA, TRAILING_COMMA, COMMENTS>

§

impl<const COMMA: bool, const TRAILING_COMMA: bool, const COMMENTS: bool> Sync for CTConfig<COMMA, TRAILING_COMMA, COMMENTS>

§

impl<const COMMA: bool, const TRAILING_COMMA: bool, const COMMENTS: bool> Unpin for CTConfig<COMMA, TRAILING_COMMA, COMMENTS>

§

impl<const COMMA: bool, const TRAILING_COMMA: bool, const COMMENTS: bool> UnwindSafe for CTConfig<COMMA, TRAILING_COMMA, COMMENTS>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.