pub struct TreeNode {
pub name: String,
pub type: NodeType,
pub description: Option<String>,
pub examples: Vec<String>,
pub enum: Option<Vec<String>>,
}
Expand description
Parser schema structure node
Fields§
§name: String
The name of the schema
type: NodeType
The type of the schema
description: Option<String>
The description provided for the schema, if available
examples: Vec<String>
Examples values for the schema, if available
enum: Option<Vec<String>>
Discrete values of the schema, if specified
Implementations§
Source§impl TreeNode
impl TreeNode
Sourcepub fn print_name(&self) -> String
pub fn print_name(&self) -> String
Get the name of the schema, alongside with a symbol indicating its type
Sourcepub fn merge_with(self, other: Self) -> Self
pub fn merge_with(self, other: Self) -> Self
Merge two TreeNode
Sourcepub fn example_value(&self, max_recursion: usize) -> Value
pub fn example_value(&self, max_recursion: usize) -> Value
Get JSON example value
Sourcepub fn json_schema(&self) -> Value
pub fn json_schema(&self) -> Value
Turn object into JSON schema
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TreeNode
impl RefUnwindSafe for TreeNode
impl Send for TreeNode
impl Sync for TreeNode
impl Unpin for TreeNode
impl UnwindSafe for TreeNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more