Skip to main content

PropertyHook

Trait PropertyHook 

Source
pub trait PropertyHook<O, K, V, H> {
    type Error;

    // Required methods
    fn get(
        &mut self,
        context: &mut AccessContext<O, K>,
        hook: &H,
        receiver: &O,
        key: &K,
    ) -> Result<V, AccessError<Self::Error>>;
    fn set(
        &mut self,
        context: &mut AccessContext<O, K>,
        hook: &H,
        receiver: &O,
        key: &K,
        value: V,
    ) -> Result<(), AccessError<Self::Error>>;
}
Expand description

Caller-owned interpretation of accessor hook tokens.

Required Associated Types§

Source

type Error

Hook-specific error.

Required Methods§

Source

fn get( &mut self, context: &mut AccessContext<O, K>, hook: &H, receiver: &O, key: &K, ) -> Result<V, AccessError<Self::Error>>

Invokes a getter with the original receiver, not merely the owner where the descriptor was found.

Source

fn set( &mut self, context: &mut AccessContext<O, K>, hook: &H, receiver: &O, key: &K, value: V, ) -> Result<(), AccessError<Self::Error>>

Invokes a setter with the original receiver.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§