@@ -52,12 +52,47 @@ pub struct AnalysisOptions {
5252 pub default_scope : Scope ,
5353 /// Type information for event records being queried.
5454 pub event_type_info : Type ,
55- /// Collections of types that are not defined in the EventQL reference but yet
56- /// allow the user to use.
55+ /// Custom types that are not defined in the EventQL reference.
56+ ///
57+ /// This set allows users to register custom type names that can be used
58+ /// in type conversion expressions (e.g., `field AS CustomType`). Custom
59+ /// type names are case-insensitive.
60+ ///
61+ /// # Examples
62+ ///
63+ /// ```
64+ /// use eventql_parser::prelude::AnalysisOptions;
65+ ///
66+ /// let options = AnalysisOptions::default()
67+ /// .add_custom_type("Foobar");
68+ /// ```
5769 pub custom_types : HashSet < Ascii < String > > ,
5870}
5971
6072impl AnalysisOptions {
73+ /// Adds a custom type name to the analysis options.
74+ ///
75+ /// Custom types allow you to use type conversion syntax with types that are
76+ /// not part of the standard EventQL type system. The type name is stored
77+ /// case-insensitively.
78+ ///
79+ /// # Arguments
80+ ///
81+ /// * `value` - The custom type name to register
82+ ///
83+ /// # Returns
84+ ///
85+ /// Returns `self` to allow for method chaining.
86+ ///
87+ /// # Examples
88+ ///
89+ /// ```
90+ /// use eventql_parser::prelude::AnalysisOptions;
91+ ///
92+ /// let options = AnalysisOptions::default()
93+ /// .add_custom_type("Timestamp")
94+ /// .add_custom_type("UUID");
95+ /// ```
6196 pub fn add_custom_type < ' a > ( mut self , value : impl Into < Cow < ' a , str > > ) -> Self {
6297 match value. into ( ) {
6398 Cow :: Borrowed ( t) => self . custom_types . insert ( Ascii :: new ( t. to_owned ( ) ) ) ,
0 commit comments