pub struct DatabaseManager { /* private fields */ }Expand description
Database manager for FAI Protocol
Implementations§
Source§impl DatabaseManager
impl DatabaseManager
Sourcepub fn connection(&self) -> &Connection
pub fn connection(&self) -> &Connection
Get access to the database connection (for network module usage)
Sourcepub fn add_to_staging(&self, path: &str, hash: &str, size: u64) -> Result<()>
pub fn add_to_staging(&self, path: &str, hash: &str, size: u64) -> Result<()>
Add a file to the staging area
§Arguments
path- File path relative to repository roothash- Content hash of the filesize- File size in bytes
Sourcepub fn clear_staging(&self) -> Result<()>
pub fn clear_staging(&self) -> Result<()>
Clear all files from the staging area
Sourcepub fn create_commit(
&self,
hash: &str,
message: &str,
parent: Option<&str>,
files: &[(String, String, u64)],
) -> Result<()>
pub fn create_commit( &self, hash: &str, message: &str, parent: Option<&str>, files: &[(String, String, u64)], ) -> Result<()>
Create a new commit
§Arguments
hash- Commit hashmessage- Commit messageparent- Optional parent commit hashfiles- List of files included in this commit
Auto Trait Implementations§
impl !Freeze for DatabaseManager
impl !RefUnwindSafe for DatabaseManager
impl Send for DatabaseManager
impl !Sync for DatabaseManager
impl Unpin for DatabaseManager
impl !UnwindSafe for DatabaseManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more