@@ -132,7 +132,16 @@ impl<T: Bind> Bind for UnaryExpression<T> {
132132}
133133
134134impl < T > UnaryExpression < T > {
135- pub ( crate ) fn new ( op : PredicateOperator , term : T ) -> Self {
135+ /// Creates a unary expression with the given operator and term.
136+ ///
137+ /// # Example
138+ ///
139+ /// ```rust
140+ /// use iceberg::expr::{PredicateOperator, Reference, UnaryExpression};
141+ ///
142+ /// UnaryExpression::new(PredicateOperator::IsNull, Reference::new("c"));
143+ /// ```
144+ pub fn new ( op : PredicateOperator , term : T ) -> Self {
136145 debug_assert ! ( op. is_unary( ) ) ;
137146 Self { op, term }
138147 }
@@ -171,7 +180,21 @@ impl<T: Debug> Debug for BinaryExpression<T> {
171180}
172181
173182impl < T > BinaryExpression < T > {
174- pub ( crate ) fn new ( op : PredicateOperator , term : T , literal : Datum ) -> Self {
183+ /// Creates a binary expression with the given operator, term and literal.
184+ ///
185+ /// # Example
186+ ///
187+ /// ```rust
188+ /// use iceberg::expr::{BinaryExpression, PredicateOperator, Reference};
189+ /// use iceberg::spec::Datum;
190+ ///
191+ /// BinaryExpression::new(
192+ /// PredicateOperator::LessThanOrEq,
193+ /// Reference::new("a"),
194+ /// Datum::int(10),
195+ /// );
196+ /// ```
197+ pub fn new ( op : PredicateOperator , term : T , literal : Datum ) -> Self {
175198 debug_assert ! ( op. is_binary( ) ) ;
176199 Self { op, term, literal }
177200 }
0 commit comments