Skip to main content

LocalChange

Struct LocalChange 

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

Fields§

§offsets: Offsets§hashed: Hashed<Hunk, Author>§unhashed: Option<Value>

unhashed TOML extra contents.

§contents: Vec<u8>

The contents.

Implementations§

Source§

impl LocalChange<Hunk<Option<Hash>, Local>, Author>

Source

pub fn write_all_deps_old<F: FnMut(Hash) -> Result<(), ChangeError>>( &self, f: F, ) -> Result<(), ChangeError>

Source

pub fn write<W: WriteChangeLine, C: ChangeStore>( &self, changes: &C, hash: Option<Hash>, write_header: bool, w: W, ) -> Result<(), TextSerError<C::Error>>

Source§

impl LocalChange<BaseHunk<Atom<Option<Hash>>, Local>, Author>

Source

pub fn read_and_deps<R: BufRead, T: ChannelTxnT + DepsTxnT<DepsError = <T as GraphTxnT>::GraphError>>( r: R, updatables: &mut HashMap<usize, InodeUpdate>, txn: &T, channel: &ChannelRef<T>, ) -> Result<Self, TextDeErrorDeps<T>>

Source

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

Source§

impl LocalChange<BaseHunk<Atom<Option<Hash>>, Local>, Author>

Source

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

Source

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

Source§

impl LocalChange<BaseHunk<Atom<Option<Hash>>, Local>, Author>

Source

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

Source§

impl LocalChange<Hunk<Option<Hash>, Local>, Author>

Source

pub const OFFSETS_SIZE: u64 = 56

Source

pub fn make_change<T: ChannelTxnT + DepsTxnT<DepsError = <T as GraphTxnT>::GraphError>>( txn: &T, channel: &ChannelRef<T>, changes: Vec<Hunk<Option<Hash>, Local>>, contents: Vec<u8>, header: ChangeHeader, metadata: Vec<u8>, ) -> Result<Self, MakeChangeError<T>>

Source

pub fn write_all_deps<F: FnMut(Hash) -> Result<(), ChangeError>>( &self, f: F, ) -> Result<(), ChangeError>

Source§

impl LocalChange<BaseHunk<Atom<Option<Hash>>, Local>, Author>

Source

pub fn size_no_contents<R: Read + Seek>(r: &mut R) -> Result<u64, ChangeError>

Source

pub fn serialize<W: Write, E: From<ChangeError>, F: FnOnce(&mut Self, &Hash) -> Result<(), E>>( &mut self, w: W, f: F, ) -> Result<Hash, E>

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

Source

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

Deserialise a change from the file given as input file.

Source

pub fn deserialize(file: &str, hash: Option<&Hash>) -> Result<Self, ChangeError>

Deserialise a change from the file given as input file.

Source

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

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.

Methods from Deref<Target = Hashed<Hunk<Option<Hash>, Local>, Author>>§

Source

pub fn write_all_deps<F: FnMut(Hash) -> Result<(), ChangeError>>( &self, f: F, ) -> Result<(), ChangeError>

Trait Implementations§

Source§

impl<Hunk: Clone, Author: Clone> Clone for LocalChange<Hunk, Author>

Source§

fn clone(&self) -> LocalChange<Hunk, Author>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<Hunk: Debug, Author: Debug> Debug for LocalChange<Hunk, Author>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for LocalChange<Hunk<Option<Hash>, Local>, Author>

Source§

fn default() -> Self

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

impl Deref for LocalChange<Hunk<Option<Hash>, Local>, Author>

Source§

type Target = Hashed<BaseHunk<Atom<Option<Hash>>, Local>, Author>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for LocalChange<Hunk<Option<Hash>, Local>, Author>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<Hunk: PartialEq, Author: PartialEq> PartialEq for LocalChange<Hunk, Author>

Source§

fn eq(&self, other: &LocalChange<Hunk, Author>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<Hunk: PartialEq, Author: PartialEq> StructuralPartialEq for LocalChange<Hunk, Author>

Auto Trait Implementations§

§

impl<Hunk, Author> Freeze for LocalChange<Hunk, Author>

§

impl<Hunk, Author> RefUnwindSafe for LocalChange<Hunk, Author>
where Hunk: RefUnwindSafe, Author: RefUnwindSafe,

§

impl<Hunk, Author> Send for LocalChange<Hunk, Author>
where Hunk: Send, Author: Send,

§

impl<Hunk, Author> Sync for LocalChange<Hunk, Author>
where Hunk: Sync, Author: Sync,

§

impl<Hunk, Author> Unpin for LocalChange<Hunk, Author>
where Hunk: Unpin, Author: Unpin,

§

impl<Hunk, Author> UnsafeUnpin for LocalChange<Hunk, Author>

§

impl<Hunk, Author> UnwindSafe for LocalChange<Hunk, Author>
where Hunk: UnwindSafe, Author: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.