Skip to main content

ClientDatabaseWorker

Struct ClientDatabaseWorker 

Source
pub struct ClientDatabaseWorker<Block, StorageBackend>
where Block: GenericOwnedBlock,
{ /* private fields */ }
Expand description

Worker that writes everything ClientDatabase persists, returned by ClientDatabase::open()

Implementations§

Source§

impl<Block, StorageBackend> ClientDatabaseWorker<Block, StorageBackend>
where Block: GenericOwnedBlock, StorageBackend: ClientDatabaseStorageBackend,

Source

pub async fn run(self) -> Result<(), ClientDatabaseWorkerError>

Run the worker until all database handles are dropped and everything sent to it is written, or until a write fails

Trait Implementations§

Source§

impl<Block, StorageBackend: Debug> Debug for ClientDatabaseWorker<Block, StorageBackend>
where Block: GenericOwnedBlock + Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Block, StorageBackend> !RefUnwindSafe for ClientDatabaseWorker<Block, StorageBackend>

§

impl<Block, StorageBackend> !UnwindSafe for ClientDatabaseWorker<Block, StorageBackend>

§

impl<Block, StorageBackend> Forget for ClientDatabaseWorker<Block, StorageBackend>

§

impl<Block, StorageBackend> Freeze for ClientDatabaseWorker<Block, StorageBackend>
where *const ArcInner<RwLock<State<Block>>> is !null: Freeze, PhantomData<RwLock<State<Block>>>: Freeze, StorageBackend: Freeze, *const u8 is !null: Freeze, PhantomData<OwnedAlignedBuffer<Align<4096>>>: Freeze, PhantomData<WriteInFlight>: Freeze, [LogEnd; 2]: Freeze, PhantomData<u32>: Freeze, PhantomData<SegmentHeader>: Freeze, PhantomData<SuperSegmentHeader>: Freeze, *const ArcInner<Chan<Task, Semaphore>> is !null: Freeze, PhantomData<ArcInner<Chan<Task, Semaphore>>>: Freeze, PhantomData<BlockInFlight>: Freeze,

§

impl<Block, StorageBackend> Move for ClientDatabaseWorker<Block, StorageBackend>

§

impl<Block, StorageBackend> Send for ClientDatabaseWorker<Block, StorageBackend>
where StorageBackend: Send, Arc<RwLock<State<Block>>>: Send, RawVecInner: Send, InnerBuffer: Send, Arc<Inner<(Result<(), StorageBackendError>, SharedAlignedBuffer<Align<4096>>)>>: Send, [LogEnd; 2]: Send, Arc<Chan<Task, Semaphore>>: Send,

§

impl<Block, StorageBackend> Sync for ClientDatabaseWorker<Block, StorageBackend>
where StorageBackend: Sync, Arc<RwLock<State<Block>>>: Sync, RawVecInner: Sync, InnerBuffer: Sync, Arc<Inner<(Result<(), StorageBackendError>, SharedAlignedBuffer<Align<4096>>)>>: Sync, [LogEnd; 2]: Sync, Arc<Chan<Task, Semaphore>>: Sync,

§

impl<Block, StorageBackend> Unpin for ClientDatabaseWorker<Block, StorageBackend>
where Block: Unpin, StorageBackend: Unpin, *const ArcInner<RwLock<State<Block>>> is !null: Unpin, Align8<usize>: Unpin, Align8<*mut Inner<()>>: Unpin, *const u8 is !null: Unpin, *const ArcInner<MerkleMountainRange<4294967295, Blake3StaticMerkleHasher<*b"\xffoK\xc6\xc4<2\x83\xd0H\xee\x93\x87.\xa2\x17\xb5\xcb\x95a\xb8\xfby\xa1\x1d\xec\xcb\x03\rq\x0c(">>> is !null: Unpin, *const ArcInner<[ContractSlotState]> is !null: Unpin, *const ArcInner<[ShardSegmentRoot]> is !null: Unpin, <Block as GenericOwnedBlock>::Header: Unpin, *const ClientDatabaseBlock<Block> is !null: Unpin, ClientDatabaseBlock<Block>: Unpin, *const LeafNode<ShardIndex, LocalSegmentIndex> is !null: Unpin, Box<(ShardIndex, LocalSegmentIndex)>: Unpin, Receiver<(Result<(), StorageBackendError>, SharedAlignedBuffer<Align<4096>>)>: Unpin, [LogEnd; 2]: Unpin, Receiver<Task>: Unpin,

§

impl<Block, StorageBackend> UnsafeUnpin for ClientDatabaseWorker<Block, StorageBackend>
where *const ArcInner<RwLock<State<Block>>> is !null: UnsafeUnpin, PhantomData<RwLock<State<Block>>>: UnsafeUnpin, StorageBackend: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<OwnedAlignedBuffer<Align<4096>>>: UnsafeUnpin, PhantomData<WriteInFlight>: UnsafeUnpin, [LogEnd; 2]: UnsafeUnpin, PhantomData<u32>: UnsafeUnpin, PhantomData<SegmentHeader>: UnsafeUnpin, PhantomData<SuperSegmentHeader>: UnsafeUnpin, *const ArcInner<Chan<Task, Semaphore>> is !null: UnsafeUnpin, PhantomData<ArcInner<Chan<Task, Semaphore>>>: UnsafeUnpin, PhantomData<BlockInFlight>: UnsafeUnpin,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more