Skip to main content

Hook

Struct Hook 

Source
pub struct Hook {
    pub filter: Option<Arc<dyn Filter>>,
    pub attribute: Option<Arc<dyn Attribute>>,
    pub join_filter: Option<Arc<dyn JoinFilter>>,
}
Expand description

A hook a builder accepts: one object may filter, resolve attributes and filter joins at once (as Tenant filters both tables and joins).

PHP: Utopia\Query\Hook, whose implementations a builder sorts by the interfaces they implement.

Fields§

§filter: Option<Arc<dyn Filter>>

The filter part.

§attribute: Option<Arc<dyn Attribute>>

The attribute part.

§join_filter: Option<Arc<dyn JoinFilter>>

The join filter part.

Implementations§

Source§

impl Hook

Source

pub fn filter(filter: impl Filter + 'static) -> Self

A hook that only filters.

Source

pub fn attribute(attribute: impl Attribute + 'static) -> Self

A hook that only resolves attributes.

Source

pub fn join_filter(join_filter: impl JoinFilter + 'static) -> Self

A hook that only filters joins.

Trait Implementations§

Source§

impl Clone for Hook

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for Hook

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<Map> for Hook

Source§

fn from(map: Map) -> Self

Map resolves attributes.

Source§

impl From<Tenant> for Hook

Source§

fn from(tenant: Tenant) -> Self

Tenant filters both tables and joins.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Hook

§

impl !UnwindSafe for Hook

§

impl Forget for Hook

§

impl Freeze for Hook
where *const ArcInner<dyn Filter> is !null: Freeze, PhantomData<ArcInner<dyn Filter>>: Freeze, *const ArcInner<dyn Attribute> is !null: Freeze, PhantomData<ArcInner<dyn Attribute>>: Freeze, *const ArcInner<dyn JoinFilter> is !null: Freeze, PhantomData<ArcInner<dyn JoinFilter>>: Freeze,

§

impl Move for Hook

§

impl Send for Hook
where Arc<dyn Filter>: Send, Arc<dyn Attribute>: Send, Arc<dyn JoinFilter>: Send,

§

impl Sync for Hook
where Arc<dyn Filter>: Sync, Arc<dyn Attribute>: Sync, Arc<dyn JoinFilter>: Sync,

§

impl Unpin for Hook
where Arc<dyn Filter>: Unpin, Arc<dyn Attribute>: Unpin, Arc<dyn JoinFilter>: Unpin,

§

impl UnsafeUnpin for Hook
where *const ArcInner<dyn Filter> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Filter>>: UnsafeUnpin, *const ArcInner<dyn Attribute> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn Attribute>>: UnsafeUnpin, *const ArcInner<dyn JoinFilter> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn JoinFilter>>: UnsafeUnpin,

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, 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.