Struct bonsaidb::files::direct::FileBuilder
source · pub struct FileBuilder<'a, Config>where
Config: FileConfig,{ /* private fields */ }
Expand description
A builder to create a File
.
Implementations§
source§impl<'a, Config> FileBuilder<'a, Config>where
Config: FileConfig,
impl<'a, Config> FileBuilder<'a, Config>where Config: FileConfig,
sourcepub fn at_path<Path>(self, path: Path) -> FileBuilder<'a, Config>where
Path: Into<String>,
pub fn at_path<Path>(self, path: Path) -> FileBuilder<'a, Config>where Path: Into<String>,
Creates this file at path
. This does not change the file’s name
specified when creating the builder.
sourcepub fn contents(self, contents: &'a [u8]) -> FileBuilder<'a, Config>
pub fn contents(self, contents: &'a [u8]) -> FileBuilder<'a, Config>
Sets the file’s initial contents.
sourcepub fn metadata(
self,
metadata: <Config as FileConfig>::Metadata
) -> FileBuilder<'a, Config>
pub fn metadata( self, metadata: <Config as FileConfig>::Metadata ) -> FileBuilder<'a, Config>
Sets the file’s initial metadata.
sourcepub fn create<Database>(
self,
database: &Database
) -> Result<File<Blocking<Database>, Config>, Error>where
Database: Connection + Clone,
pub fn create<Database>( self, database: &Database ) -> Result<File<Blocking<Database>, Config>, Error>where Database: Connection + Clone,
Creates the file and returns a handle to the created file.
sourcepub async fn create_async<Database>(
self,
database: &Database
) -> impl Future<Output = Result<File<Async<Database>, Config>, Error>>where
Database: AsyncConnection + Clone,
pub async fn create_async<Database>( self, database: &Database ) -> impl Future<Output = Result<File<Async<Database>, Config>, Error>>where Database: AsyncConnection + Clone,
Creates the file and returns a handle to the created file.
Trait Implementations§
source§impl<'a, Config> Clone for FileBuilder<'a, Config>where
Config: Clone + FileConfig,
<Config as FileConfig>::Metadata: Clone,
impl<'a, Config> Clone for FileBuilder<'a, Config>where Config: Clone + FileConfig, <Config as FileConfig>::Metadata: Clone,
source§fn clone(&self) -> FileBuilder<'a, Config>
fn clone(&self) -> FileBuilder<'a, Config>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a, Config> RefUnwindSafe for FileBuilder<'a, Config>where Config: RefUnwindSafe, <Config as FileConfig>::Metadata: RefUnwindSafe,
impl<'a, Config> Send for FileBuilder<'a, Config>
impl<'a, Config> Sync for FileBuilder<'a, Config>
impl<'a, Config> Unpin for FileBuilder<'a, Config>where <Config as FileConfig>::Metadata: Unpin,
impl<'a, Config> UnwindSafe for FileBuilder<'a, Config>where Config: UnwindSafe, <Config as FileConfig>::Metadata: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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