pub enum OnDropPolicy {
IgnoreLogFileLock,
DiscardLogBuffer,
}Expand description
Defines the policy for handling log file flushing when a FileStream
instance is dropped.
§Examples
Setting on drop policy:
let mut file_stream = FileStream::default();
file_stream.set_on_drop_policy(OnDropPolicy::IgnoreLogFileLock);Variants§
IgnoreLogFileLock
Ignore the log file lock and write to the file anyway. This may cause race conditions
DiscardLogBuffer
Respect the log file lock and don’t write to the log file. This may cause data loss
Trait Implementations§
Source§impl Clone for OnDropPolicy
impl Clone for OnDropPolicy
Source§fn clone(&self) -> OnDropPolicy
fn clone(&self) -> OnDropPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OnDropPolicy
impl Debug for OnDropPolicy
Source§impl Default for OnDropPolicy
impl Default for OnDropPolicy
Source§fn default() -> OnDropPolicy
fn default() -> OnDropPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for OnDropPolicy
impl<'de> Deserialize<'de> for OnDropPolicy
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for OnDropPolicy
impl Display for OnDropPolicy
Source§impl Hash for OnDropPolicy
impl Hash for OnDropPolicy
Source§impl Ord for OnDropPolicy
impl Ord for OnDropPolicy
Source§fn cmp(&self, other: &OnDropPolicy) -> Ordering
fn cmp(&self, other: &OnDropPolicy) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for OnDropPolicy
impl PartialEq for OnDropPolicy
Source§impl PartialOrd for OnDropPolicy
impl PartialOrd for OnDropPolicy
Source§impl Serialize for OnDropPolicy
impl Serialize for OnDropPolicy
impl Copy for OnDropPolicy
impl Eq for OnDropPolicy
impl StructuralPartialEq for OnDropPolicy
Auto Trait Implementations§
impl Freeze for OnDropPolicy
impl RefUnwindSafe for OnDropPolicy
impl Send for OnDropPolicy
impl Sync for OnDropPolicy
impl Unpin for OnDropPolicy
impl UnwindSafe for OnDropPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more