Trait jsonpath_rust::path::Path

source ·
pub trait Path<'a> {
    type Data;

    // Provided methods
    fn find(
        &self,
        input: JsonPathValue<'a, Self::Data>
    ) -> Vec<JsonPathValue<'a, Self::Data>> { ... }
    fn flat_find(
        &self,
        input: Vec<JsonPathValue<'a, Self::Data>>,
        _is_search_length: bool
    ) -> Vec<JsonPathValue<'a, Self::Data>> { ... }
    fn cfg(&self) -> JsonPathConfig { ... }
    fn needs_all(&self) -> bool { ... }
}
Expand description

The trait defining the behaviour of processing every separated element. type Data usually stands for json [Value] The trait also requires to have a root json to process. It needs in case if in the filter there will be a pointer to the absolute path

Required Associated Types§

Provided Methods§

source

fn find( &self, input: JsonPathValue<'a, Self::Data> ) -> Vec<JsonPathValue<'a, Self::Data>>

when every element needs to handle independently

source

fn flat_find( &self, input: Vec<JsonPathValue<'a, Self::Data>>, _is_search_length: bool ) -> Vec<JsonPathValue<'a, Self::Data>>

when the whole output needs to handle

source

fn cfg(&self) -> JsonPathConfig

source

fn needs_all(&self) -> bool

defines when we need to invoke find or flat_find

Implementors§