[−][src]Struct flips::BpsDeltaBuilder
A builder to create a BPS patch.
This type is as generic as possible, making it easy to use any type that can be viewed as a slice of bytes.
Example
let patch = flips::BpsLinearBuilder::new() .source(&b"some source bytes"[..]) .target(&b"some target bytes"[..]) .build() .expect("could not create patch");
Methods
impl<S: AsRef<[u8]>, T: AsRef<[u8]>> BpsDeltaBuilder<S, T, &'static [u8]>
[src]
pub fn new() -> Self
[src]
Create a new builder for an BPS patch.
pub fn metadata<M: AsRef<[u8]>, B: Into<Option<M>>>(
&mut self,
buffer: B
) -> BpsDeltaBuilder<S, T, M>
[src]
&mut self,
buffer: B
) -> BpsDeltaBuilder<S, T, M>
Set the metadata buffer for the patch, if any.
impl<S: AsRef<[u8]>, T: AsRef<[u8]>, M: AsRef<[u8]>> BpsDeltaBuilder<S, T, M>
[src]
pub fn source(&mut self, source: S) -> &mut Self
[src]
Set the source buffer for the patch.
pub fn more_memory(&mut self, moremem: bool) -> &mut Self
[src]
Enable the patcher to use more memory.
According to the Flips documentation, enabling more memory for the delta patcher results in about 5x the size of the patch to be used as memory.
pub fn target(&mut self, target: T) -> &mut Self
[src]
Set the target buffer for the patch.
#[must_use]pub fn build(&mut self) -> Result<BpsPatch<FlipsMemory>>
[src]
Build an BPS patch from source
to target
with metadata
if any.
Error
If either source
or target
was not given, this method will
return Error::Canceled
.
Trait Implementations
impl<S: Clone + AsRef<[u8]>, T: Clone + AsRef<[u8]>, M: Clone + AsRef<[u8]>> Clone for BpsDeltaBuilder<S, T, M>
[src]
fn clone(&self) -> BpsDeltaBuilder<S, T, M>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S: Debug + AsRef<[u8]>, T: Debug + AsRef<[u8]>, M: Debug + AsRef<[u8]>> Debug for BpsDeltaBuilder<S, T, M>
[src]
impl<S: Default + AsRef<[u8]>, T: Default + AsRef<[u8]>, M: Default + AsRef<[u8]>> Default for BpsDeltaBuilder<S, T, M>
[src]
fn default() -> BpsDeltaBuilder<S, T, M>
[src]
Auto Trait Implementations
impl<S, T, M> RefUnwindSafe for BpsDeltaBuilder<S, T, M> where
M: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
M: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<S, T, M> Send for BpsDeltaBuilder<S, T, M> where
M: Send,
S: Send,
T: Send,
M: Send,
S: Send,
T: Send,
impl<S, T, M> Sync for BpsDeltaBuilder<S, T, M> where
M: Sync,
S: Sync,
T: Sync,
M: Sync,
S: Sync,
T: Sync,
impl<S, T, M> Unpin for BpsDeltaBuilder<S, T, M> where
M: Unpin,
S: Unpin,
T: Unpin,
M: Unpin,
S: Unpin,
T: Unpin,
impl<S, T, M> UnwindSafe for BpsDeltaBuilder<S, T, M> where
M: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
M: UnwindSafe,
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,