Skip to main content

EventTypeRecordBuilder

Struct EventTypeRecordBuilder 

Source
pub struct EventTypeRecordBuilder<'a> { /* private fields */ }
Expand description

Builder for defining the fields of a record-shaped event type.

Obtained by calling EventTypeBuilder::define_record. Add fields with prop and finalize with as_default_event_type or for_data_source to return to the EventTypeBuilder.

Implementations§

Source§

impl<'a> EventTypeRecordBuilder<'a>

Source

pub fn prop_when(self, test: bool, name: &str, tpe: Type) -> Self

Conditionally adds a field to the event record type.

Source

pub fn prop(self, name: &str, tpe: Type) -> Self

Adds a field with the given name and type to the event record type.

Source

pub fn as_default_event_type(self) -> EventTypeBuilder<'a>

Finalizes the event record type and returns the SessionBuilder.

Source

pub fn for_data_source(self, data_source: &str) -> EventTypeBuilder<'a>

Finalizes the record type and registers it for a specific named data source.

Queries targeting data_source will use this record type for type checking. Data source names are case-insensitive. Returns the EventTypeBuilder to allow chaining further type declarations.

Source

pub fn build(self) -> (Type, TypeRef)

Creates a record type and returns it with its registered type reference.

Use the returned Type where an API expects the record type directly. Use the returned TypeRef when building another type that needs to point at this record, such as Type::Array.

The TypeRef belongs to the current SessionBuilder’s arena and should only be used with types configured through the same builder.

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.