Skip to main content

TxDeltaWindow

Struct TxDeltaWindow 

Source
pub struct TxDeltaWindow { /* private fields */ }
Expand description

TxDelta window with RAII cleanup

Implementations§

Source§

impl TxDeltaWindow

Source

pub fn pool(&self) -> &Pool<'_>

Get a reference to the underlying pool

Source

pub fn as_mut_ptr(&mut self) -> *mut svn_txdelta_window_t

Get the mutable raw pointer to the window (use with caution)

Source

pub fn as_ptr(&self) -> *const svn_txdelta_window_t

Get the raw pointer to the window.

Source

pub fn new() -> Self

Creates a new TxDelta window.

Source

pub fn from_parts( sview_offset: u64, sview_len: u64, tview_len: u64, src_ops: i32, ops: &[(i32, u64, u64)], new_data: &[u8], ) -> Self

Creates a TxDelta window from constituent parts.

§Arguments
  • sview_offset - Source view offset
  • sview_len - Source view length
  • tview_len - Target view length
  • src_ops - Number of source operations (usually ignored)
  • ops - Delta operations as (action_code, offset, length) tuples
  • new_data - New data buffer
Source

pub fn sview_len(&self) -> apr_size_t

Gets the source view length.

Source

pub fn tview_len(&self) -> apr_size_t

Gets the target view length.

Source

pub fn sview_offset(&self) -> FileSize

Gets the source view offset.

Source

pub fn src_ops(&self) -> i32

Gets the number of source operations.

Source

pub fn ops(&self) -> Vec<(i32, u64, u64)>

Gets the delta operations as (action_code, offset, length) tuples.

Source

pub fn new_data(&self) -> &[u8]

Gets the new data buffer.

Source

pub fn compose(a: &Self, b: &Self) -> Self

Composes two TxDelta windows.

Source

pub fn apply_instructions( &mut self, source: &mut [u8], target: &mut Vec<u8>, ) -> Result<(), Error<'_>>

Applies the window instructions to transform source to target.

Source

pub fn dup(&self) -> Self

Creates a duplicate of the window.

Trait Implementations§

Source§

impl Default for TxDeltaWindow

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for TxDeltaWindow

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.