fieldmasker 0.0.1

A utility for selecting and filtering response fields via field masks.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use thiserror::Error;

/// Errors produced while parsing or validating field masks.
#[derive(Debug, Error, PartialEq, Eq)]
pub enum FieldMaskError {
    /// The supplied field mask string has invalid syntax.
    ///
    /// For example: empty segments (`"a..b"`), leading/trailing dots (`".a"` or `"a."`),
    /// or an entirely empty mask when a non-empty one is required.
    #[error("invalid field mask syntax")]
    InvalidSyntax,

    /// The mask references an unknown path with respect to the `MaskSpec` schema.
    ///
    /// The contained string is the full path that failed validation.
    #[error("unknown field mask path: `{0}`")]
    UnknownPath(String),
}