[][src]Trait sitter::person::PersonHook

pub trait PersonHook {
    pub fn validate(&self, person: &PersonRequest, action: &str) -> Result<()>;
pub fn prepare(
        &self,
        person: &mut PersonRequest,
        action: &str
    ) -> Result<()>;
pub fn prepare_id(&self, id: &mut Uuid, action: &str) -> Result<()>;
pub fn processed(&self, person: &mut Person, action: &str) -> Result<()>; }

Required methods

pub fn validate(&self, person: &PersonRequest, action: &str) -> Result<()>[src]

Validate the PersonRequest.

pub fn prepare(&self, person: &mut PersonRequest, action: &str) -> Result<()>[src]

Do any necessary preprocessing to the PersonRequest.

pub fn prepare_id(&self, id: &mut Uuid, action: &str) -> Result<()>[src]

Do any necessary preprocessing to the Id (Read and Delete).

pub fn processed(&self, person: &mut Person, action: &str) -> Result<()>[src]

Do any necessary postprocessing to the Person.

Loading content...

Implementors

impl PersonHook for Email[src]

pub fn validate(
    &self,
    person_request: &PersonRequest,
    _action: &str
) -> Result<()>
[src]

Validate the syntax of an e-mail address.

pub fn prepare(
    &self,
    _person_request: &mut PersonRequest,
    _action: &str
) -> Result<()>
[src]

No preprocessing is done of emails.

pub fn prepare_id(&self, _id: &mut Uuid, _action: &str) -> Result<()>[src]

No prepare_id is done of emails.

pub fn processed(&self, _person: &mut Person, _action: &str) -> Result<()>[src]

No postprocessing is done of emails.

impl PersonHook for Logger[src]

pub fn validate(
    &self,
    _person_request: &PersonRequest,
    _action: &str
) -> Result<()>
[src]

No logger event for validate.

pub fn prepare(
    &self,
    _person_request: &mut PersonRequest,
    _action: &str
) -> Result<()>
[src]

No logger event for validate.

pub fn prepare_id(&self, _id: &mut Uuid, _action: &str) -> Result<()>[src]

No logger event for prepare_id.

pub fn processed(&self, person: &mut Person, action: &str) -> Result<()>[src]

Log activity in postsave.

impl PersonHook for Password[src]

pub fn validate(&self, person: &PersonRequest, action: &str) -> Result<()>[src]

Simple password validation function, requires passwords be at least 8 characters in length.

pub fn prepare_id(&self, _id: &mut Uuid, _action: &str) -> Result<()>[src]

No prepring of the id is done for passwords.

pub fn processed(&self, _person: &mut Person, _action: &str) -> Result<()>[src]

No postprocessing is done of passwords.

Loading content...