Struct FieldPath

Source
pub struct FieldPath(/* private fields */);
Expand description

Field path supporting up to 5 levels of nesting

Implementations§

Source§

impl FieldPath

Source

pub fn new(path: impl Into<String>) -> Result<Self, AppsyncError>

Creates a new field path from a string-like value

§Arguments
  • path - Field path as a string
§Errors

Returns ValidationError if path exceeds 256 characters

§Examples
let path = FieldPath::new("user.profile.name")?;
Source

pub unsafe fn new_unchecked(path: impl Into<String>) -> Self

Creates a new field path from a string-like value without validation

§Safety

This function skips validation of the field path. The caller must ensure:

  • Path length does not exceed 256 characters
  • Path contains valid field references only
  • Path nesting depth does not exceed 5 levels
§Examples
let path = unsafe { FieldPath::new_unchecked("user.name") };
Source

pub fn eq<IFSB: IFSBValueMarker>(self, ifsb: IFSB) -> FieldFilter

Creates an equality filter

Source

pub unsafe fn eq_unchecked<T: Serialize>(self, value: T) -> FieldFilter

Creates an equality filter from any serializable value

§Safety

The caller must ensure the value serializes to either:

  • A number
  • A string
  • A boolean
Source

pub fn ne<IFSB: IFSBValueMarker>(self, ifsb: IFSB) -> FieldFilter

Creates a not equal filter

Source

pub unsafe fn ne_unchecked<T: Serialize>(self, value: T) -> FieldFilter

Creates a not equal filter from any serializable value

§Safety

The caller must ensure the value serializes to either:

  • A number
  • A string
  • A boolean
Source

pub fn le<IFS: IFSValueMarker>(self, ifs: IFS) -> FieldFilter

Creates a less than or equal filter

Source

pub unsafe fn le_unchecked<T: Serialize>(self, value: T) -> FieldFilter

Creates a less than or equal filter from any serializable value

§Safety

The caller must ensure the value serializes to either:

  • A number
  • A string
Source

pub fn lt<IFS: IFSValueMarker>(self, ifs: IFS) -> FieldFilter

Creates a less than filter

Source

pub unsafe fn lt_unchecked<T: Serialize>(self, value: T) -> FieldFilter

Creates a less than filter from any serializable value

§Safety

The caller must ensure the value serializes to either:

  • A number
  • A string
Source

pub fn ge<IFS: IFSValueMarker>(self, ifs: IFS) -> FieldFilter

Creates a greater than or equal filter

Source

pub unsafe fn ge_unchecked<T: Serialize>(self, value: T) -> FieldFilter

Creates a greater than or equal filter from any serializable value

§Safety

The caller must ensure the value serializes to either:

  • A number
  • A string
Source

pub fn gt<IFS: IFSValueMarker>(self, ifs: IFS) -> FieldFilter

Creates a greater than filter

Source

pub unsafe fn gt_unchecked<T: Serialize>(self, value: T) -> FieldFilter

Creates a greater than filter from any serializable value

§Safety

The caller must ensure the value serializes to either:

  • A number
  • A string
Source

pub fn contains<IFS: IFSValueMarker>(self, ifs: IFS) -> FieldFilter

Creates a contains filter for strings or arrays

Source

pub unsafe fn contains_unchecked<T: Serialize>(self, value: T) -> FieldFilter

Creates a contains filter from any serializable value

§Safety

The caller must ensure the value serializes to either:

  • A number
  • A string
Source

pub fn not_contains<IFS: IFSValueMarker>(self, ifs: IFS) -> FieldFilter

Creates a not contains filter for strings or arrays

Source

pub unsafe fn not_contains_unchecked<T: Serialize>( self, value: T, ) -> FieldFilter

Creates a not contains filter from any serializable value

§Safety

The caller must ensure the value serializes to either:

  • A number
  • A string
Source

pub fn begins_with(self, value: impl Into<String>) -> FieldFilter

Creates a begins with filter for string fields

Source

pub fn in_values<IFS: IFSValueMarker>( self, values: impl Into<FixedVec<IFS, 5>>, ) -> FieldFilter

Creates an IN filter accepting up to 5 values

§Examples
let path = FieldPath::new("user.id")?;
let filter = path.in_values(["id1", "id2", "id3"]);
Source

pub unsafe fn in_values_unchecked<T: Serialize>( self, values: impl Into<FixedVec<T, 5>>, ) -> FieldFilter

Creates an IN filter from any array of up to 5 serializable values

§Safety

The caller must ensure each value in the array serializes to either:

  • A number
  • A string
Source

pub fn not_in<IFS: IFSValueMarker>( self, values: impl Into<FixedVec<IFS, 5>>, ) -> FieldFilter

Creates a NOT IN filter accepting up to 5 values

§Examples
let path = FieldPath::new("user.role")?;
let filter = path.not_in(["admin", "moderator"]);
Source

pub unsafe fn not_in_unchecked<T: Serialize>( self, values: impl Into<FixedVec<T, 5>>, ) -> FieldFilter

Creates a NOT IN filter from any array of up to 5 serializable values

§Safety

The caller must ensure values in the array serializes to either:

  • Numbers
  • Strings
Source

pub fn between<IFS: IFSValueMarker>(self, start: IFS, end: IFS) -> FieldFilter

Creates a BETWEEN filter that matches values in a range

Source

pub unsafe fn between_unchecked<T: Serialize>( self, start: T, end: T, ) -> FieldFilter

Creates a BETWEEN filter from any two serializable values

§Safety

The caller must ensure both values serialize to either:

  • Numbers
  • Strings
Source

pub fn contains_any<IFS: IFSValueMarker>( self, values: impl Into<FixedVec<IFS, 20>>, ) -> FieldFilter

Creates a contains any filter accepting up to 20 values

§Examples
let path = FieldPath::new("user.permissions")?;
let filter = path.contains_any(["read", "write", "delete"]);
Source

pub unsafe fn contains_any_unchecked<T: Serialize>( self, values: impl Into<FixedVec<T, 20>>, ) -> FieldFilter

Creates a contains any filter from any array of up to 20 serializable values

§Safety

The caller must ensure values in the array serializes to either:

  • Numbers
  • Strings

Trait Implementations§

Source§

impl Clone for FieldPath

Source§

fn clone(&self) -> FieldPath

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for FieldPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for FieldPath

Source§

fn eq(&self, other: &FieldPath) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for FieldPath

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FieldPath

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<B> IntoFunctionResponse<B, Body> for B
where B: Serialize,

Source§

fn into_response(self) -> FunctionResponse<B, Body>

Convert the type into a FunctionResponse.
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T