[][src]Struct libpijul::change::LocalChange

pub struct LocalChange<Local> {
    pub offsets: Offsets,
    pub hashed: Hashed<Local>,
    pub unhashed: Option<Value>,
    pub contents: Vec<u8>,
}

Fields

offsets: Offsetshashed: Hashed<Local>unhashed: Option<Value>

unhashed TOML extra contents.

contents: Vec<u8>

The contents.

Implementations

impl LocalChange<Local>[src]

pub fn knows(&self, hash: &Hash) -> bool[src]

pub fn has_edge(
    &self,
    hash: Hash,
    from: Position<Option<Hash>>,
    to: Position<Option<Hash>>,
    flags: EdgeFlags
) -> bool
[src]

impl LocalChange<Local>[src]

pub fn inverse(
    &self,
    hash: &Hash,
    header: ChangeHeader,
    metadata: Vec<u8>
) -> Self
[src]

impl<L> LocalChange<L>[src]

pub fn make_change<T: TxnT>(
    txn: &T,
    channel: &ChannelRef<T>,
    changes: Vec<Record<Option<Hash>, L>>,
    contents: Vec<u8>,
    header: ChangeHeader,
    metadata: Vec<u8>
) -> Self
[src]

pub fn new() -> Self[src]

impl LocalChange<Local>[src]

pub fn size_no_contents<R: Read + Seek>(r: &mut R) -> Result<u64, Error>[src]

pub fn serialize<W: Write>(&self, w: W) -> Result<Hash, Error>[src]

Serialise the change as a file named ".change" in directory dir, where "" is the actual hash of the change.

pub fn check_from_buffer(buf: &[u8], hash: &Hash) -> Result<(), Error>[src]

Deserialise a change from the file given as input file.

pub fn deserialize(file: &str, hash: Option<&Hash>) -> Result<Self, Error>[src]

Deserialise a change from the file given as input file.

pub fn hash(&self) -> Result<Hash, Error>[src]

Compute the hash of this change. If the zstd feature is enabled, it is probably more efficient to serialise the change (using the serialize method) at the same time, which also returns the hash.

impl LocalChange<Local>[src]

pub fn write_all_deps<F: FnMut(Hash) -> Result<(), Error>>(
    &self,
    f: F
) -> Result<(), Error>
[src]

pub fn write<W: Write, C: ChangeStore, F: FnMut(&Local, Position<Option<Hash>>) -> String>(
    &self,
    changes: &C,
    hash: Option<Hash>,
    file_name: F,
    write_header: bool,
    w: W
) -> Result<(), Error>
[src]

impl LocalChange<Local>[src]

pub fn read_and_deps<R: BufRead, T: TxnT>(
    r: R,
    updatables: &mut HashMap<usize, InodeUpdate>,
    txn: &T,
    channel: &ChannelRef<T>
) -> Result<Self, Error>
[src]

pub fn read<R: BufRead>(
    r: R,
    updatables: &mut HashMap<usize, InodeUpdate>
) -> Result<Self, Error>
[src]

Trait Implementations

impl<Local: Clone> Clone for LocalChange<Local>[src]

impl<Local: Debug> Debug for LocalChange<Local>[src]

impl Deref for LocalChange<Local>[src]

type Target = Hashed<Local>

The resulting type after dereferencing.

impl DerefMut for LocalChange<Local>[src]

impl<Local: PartialEq> PartialEq<LocalChange<Local>> for LocalChange<Local>[src]

impl<Local> StructuralPartialEq for LocalChange<Local>[src]

Auto Trait Implementations

impl<Local> RefUnwindSafe for LocalChange<Local> where
    Local: RefUnwindSafe

impl<Local> Send for LocalChange<Local> where
    Local: Send

impl<Local> Sync for LocalChange<Local> where
    Local: Sync

impl<Local> Unpin for LocalChange<Local> where
    Local: Unpin

impl<Local> UnwindSafe for LocalChange<Local> where
    Local: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,