[−][src]Struct asuran::repository::backend::multifile::index::Index
Methods
impl Index
[src]
MultiFile
index with lock free multithreading
Warning
You must call commit_index
for your changes to be committed to disk, the Index
will not do this for you
pub fn open(repository_path: impl AsRef<Path>) -> Result<Index>
[src]
Opens and reads the index, creating it if it does not exist.
Note that the repository path is the root path of the repository, not the path of the index folder.
This method will create the index folder if it does not exist.
Files who's names are not strictly base 10 integers are ignored, and will not be added to the state or written to.
This method only creates the event loop on its own, the actual index is created by
InternalIndex::open
Errors
Will return Err if
- The index folder does not exist and creating it failed
- There are no unlocked index files and creating one fails
- There is a file called "index" in the repository folder
- Some other IO error (such as lack of permissions) occurs
- The path contains non-utf8 characters
TODOs:
- Return an error if deserializing a transaction fails before the end of the file is reached
- This function can currently panic if we have to create a new index file, but someone else that while we were parsing the transaction. Resolution for this conflict needs to be implemented.
pub async fn close<'_>(&'_ mut self)
[src]
Trait Implementations
impl Clone for Index
[src]
impl Debug for Index
[src]
impl Index for Index
[src]
fn lookup_chunk<'life0, 'async_trait>(
&'life0 mut self,
id: ChunkID
) -> Pin<Box<dyn Future<Output = Option<SegmentDescriptor>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
id: ChunkID
) -> Pin<Box<dyn Future<Output = Option<SegmentDescriptor>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn set_chunk<'life0, 'async_trait>(
&'life0 mut self,
id: ChunkID,
location: SegmentDescriptor
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self,
id: ChunkID,
location: SegmentDescriptor
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn known_chunks<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = HashSet<ChunkID>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = HashSet<ChunkID>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn commit_index<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn count_chunk<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 mut self
) -> Pin<Box<dyn Future<Output = usize> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl !UnwindSafe for Index
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,