Struct ExtractFieldInfo

Source
pub struct ExtractFieldInfo<P: ExtractPlugin> {
    pub name: &'static str,
    pub field_type: ExtractFieldTypeId,
    pub is_list: bool,
    pub arg: ExtractArgType,
    pub display_name: Option<&'static str>,
    pub description: &'static str,
    pub add_output: bool,
    pub func: ExtractLambda<P>,
}
Expand description

§A description of an extracted field

You should create instances of this struct by calling field.

This struct is used to automatically generate the schema definition for the Falco plugin framework

Fields§

§name: &'static str

the name of the extracted field, generally of the form <plugin>.<field>

§field_type: ExtractFieldTypeId

the type of the extracted field

§is_list: bool

if true, the extract function returns a Vec of values, not a single one

§arg: ExtractArgType

the type of argument the extract function takes

§display_name: Option<&'static str>

the display name for the extracted field, defaulting to the name

§description: &'static str

a description for the extracted field, mandatory but defaults to the name

§add_output: bool

suggest that this field be included in output for compatible event sources

§func: ExtractLambda<P>

the function implementing the actual extraction

Implementations§

Source§

impl<P: ExtractPlugin> ExtractFieldInfo<P>

Source

pub const fn with_display(self, display_name: &'static str) -> Self

Set the display name fdr the extracted field

Source

pub const fn with_description(self, description: &'static str) -> Self

Set the description for the extracted field

Source

pub const fn add_output(self) -> Self

Suggest this field to be appended to the output string for compatible event sources

Trait Implementations§

Source§

impl<P: ExtractPlugin> Debug for ExtractFieldInfo<P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<P: ExtractPlugin> Serialize for ExtractFieldInfo<P>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

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.