Trait tikv_util::logger::file_log::Rotator[][src]

pub trait Rotator: Send {
    fn is_enabled(&self) -> bool;
fn prepare(&mut self, file: &File) -> Result<()>;
fn should_rotate(&self) -> bool;
fn on_write(&mut self, data: &[u8]) -> Result<()>;
fn on_rotate(&mut self) -> Result<()>; }

A trait that describes a file rotation operation.

Required methods

fn is_enabled(&self) -> bool[src]

Check if the option is enabled in configuration. Return true if the rotator is valid.

fn prepare(&mut self, file: &File) -> Result<()>[src]

Call by operator, initializes the states of rotators.

fn should_rotate(&self) -> bool[src]

Return if the file need to be rotated.

fn on_write(&mut self, data: &[u8]) -> Result<()>[src]

Call by operator, update rotators’ state while the operator try to write some data.

fn on_rotate(&mut self) -> Result<()>[src]

Call by operator, update rotators’ state while the operator execute a rotation.

Loading content...

Implementors

impl Rotator for RotateBySize[src]

impl Rotator for RotateByTime[src]

Loading content...