Struct redb::Builder

source ·
pub struct Builder { /* private fields */ }

Implementations§

Set the amount of memory (in bytes) used for caching data that has been read

This setting is ignored when calling create_mmapped()/open_mmapped()

Set the amount of memory (in bytes) used for caching data that has been written

This setting is ignored when calling create_mmapped()/open_mmapped()

The initial amount of usable space in bytes for the database

Databases grow dynamically, so it is generally unnecessary to set this. However, it can be used to avoid runtime overhead caused by resizing the database.

Opens the specified file as a redb database.

  • if the file does not exist, or is an empty file, a new database will be initialized in it
  • if the file is a valid redb database, it will be opened
  • otherwise this function will return an error

Opens the specified file as a redb database using the mmap backend.

  • if the file does not exist, or is an empty file, a new database will be initialized in it
  • if the file is a valid redb database, it will be opened
  • otherwise this function will return an error
Safety

Caller must ensure that the memory representing the memory-mapped file is not modified externally. In particular:

  1. the file referenced by path must not be concurrently modified by any other process
  2. an I/O failure writing back to disk must not mutate the the memory. You should consider reading this paper before assuming that your OS provides this gaurantee: https://research.cs.wisc.edu/adsl/Publications/cuttlefs-tos21.pdf

Opens an existing redb database.

Opens an existing redb database using the mmap backend.

Safety

Caller must ensure that the memory representing the memory-mapped file is not modified externally. In particular:

  1. the file referenced by path must not be concurrently modified by any other process
  2. an I/O failure writing back to disk must not mutate the the memory. You should consider reading this paper before assuming that your OS provides this gaurantee: https://research.cs.wisc.edu/adsl/Publications/cuttlefs-tos21.pdf

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.