Struct EventExporterBuilder

Source
pub struct EventExporterBuilder { /* private fields */ }
Expand description

The builder of the EventExporter

Implementations§

Source§

impl EventExporterBuilder

Source

pub fn new() -> Self

Create a default Builder, with export_format defaults to ExportFormat::PlainText

Source

pub fn set_export_format(self, fmt: ExportFormatType) -> Self

Set the export format that the ebpf program will export

Source

pub fn set_export_event_handler(self, handler: Arc<dyn EventHandler>) -> Self

Set a user-defined event handler callback

Source

pub fn set_user_context<T: Any>(self, ctx: T) -> Self

Set the user-defined context

Source

pub fn build_for_single_value_with_type_descriptor( self, export_type: TypeDescriptor, btf_container: Arc<BtfContainer>, intepreter: &BufferValueInterpreter, ) -> Result<Arc<EventExporter>>

Build an exporter use TypeDescriptor. Which can easily specify the source to obtain the value type

Source

pub fn build_for_single_value( self, export_type: &ExportedTypesStructMeta, btf_container: Arc<BtfContainer>, intepreter: &BufferValueInterpreter, ) -> Result<Arc<EventExporter>>

Build an EventExporter which is suitable for processing value-only data export_types: The type of the data that kernel program sends. The types will be verified using BTF btf_container: The BTF information

Source

pub fn build_for_key_value_with_type_desc( self, key_export_type: TypeDescriptor, value_export_type: TypeDescriptor, sample_config: &MapSampleMeta, btf_container: Arc<BtfContainer>, ) -> Result<Arc<EventExporter>>

Build an EventExporter, but use TypeDescriptor to indicate where to fetch the value type

Source

pub fn build_for_key_value( self, key_type_id: u32, value_type_id: u32, sample_config: &MapSampleMeta, export_type: &ExportedTypesStructMeta, btf_container: Arc<BtfContainer>, ) -> Result<Arc<EventExporter>>

Build an EventExporter to process sampling map key_type_id: The type id of the map key value_type_id: The type id of the map value sample_config: Detailed configuration of the sampling map export_types: Value types of the map, will be verified btf_container: The btf information

Trait Implementations§

Source§

impl Default for EventExporterBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. 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.