Struct optra::DeleteOperation [] [src]

pub struct DeleteOperation {
    // some fields omitted
}

Represents an operation which removes data from a file

Methods

impl DeleteOperation
[src]

fn new(position: u64, length: u64, timestamp: u32) -> DeleteOperation

Creates a new DeleteOperation that woll delete length bytes at position in a file

fn get_length(&self) -> u64

Gets the number of bytes that will be removed when the delete operation is applied

fn compress_to<W: Write>(&self, writer: &mut W) -> Result<()>

Compress this operation and write to writer. The output can then be expanded back into an equivilent operation using expand_from()

fn expand_from<R: Read>(reader: &mut R) -> Result<DeleteOperation>

Expand this operation from previously compressed data in reader. The data in reader should have been written using compress_to()

Trait Implementations

impl Clone for DeleteOperation
[src]

fn clone(&self) -> DeleteOperation

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl Eq for DeleteOperation
[src]

impl PartialEq for DeleteOperation
[src]

fn eq(&self, __arg_0: &DeleteOperation) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &DeleteOperation) -> bool

This method tests for !=.

impl Operation for DeleteOperation
[src]

fn get_position(&self) -> u64

Gets the position this operation will be perfomed at

fn get_increment(&self) -> i64

Gets the size change this operation will perform. For insert operations, it's the length of the data they will insert. For delete operations, it's the length of the data they will delete Read more

fn get_timestamp(&self) -> u32

Gets the current local timestamp of this operation

fn set_timestamp(&mut self, new_timestamp: u32)

Sets the local timestamp of this operation

impl Debug for DeleteOperation
[src]

fn fmt(&self, f: &mut Formatter) -> Result<()Error>

Formats the value using the given formatter.