Skip to content

Commit

Permalink
docs: add some expr examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gadomski committed Oct 4, 2024
1 parent f3336f1 commit dcd0ffe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ use serde_json::Value;
use std::str::FromStr;

/// A CQL2 expression.
///
/// # Examples
///
/// [Expr] implements [FromStr]:
///
/// ```
/// use cql2::Expr;
///
/// let expr: Expr = "landsat:scene_id = 'LC82030282019133LGN00'".parse().unwrap();
/// ```
///
/// Use [Expr::to_text], [Expr::to_json], and [Expr::to_sql] to use the CQL2,
/// and use [Expr::is_valid] to check validity.
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(untagged)]
pub enum Expr {
Expand Down

0 comments on commit dcd0ffe

Please sign in to comment.