pub struct RegistryUpdateBatch { /* private fields */ }Expand description
Batch of registry updates from a single Mutation.
Implementations§
Source§impl RegistryUpdateBatch
impl RegistryUpdateBatch
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a batch with pre-allocated capacity.
Sourcepub fn push(&mut self, update: RegistryUpdate)
pub fn push(&mut self, update: RegistryUpdate)
Add an update to the batch.
Sourcepub fn add_symbol(&mut self, path: SymbolPath, kind: SymbolKind, span: FileSpan)
pub fn add_symbol(&mut self, path: SymbolPath, kind: SymbolKind, span: FileSpan)
Add a symbol addition.
Sourcepub fn remove_symbol(&mut self, id: SymbolId)
pub fn remove_symbol(&mut self, id: SymbolId)
Add a symbol removal.
Sourcepub fn rename_symbol(&mut self, id: SymbolId, new_path: SymbolPath)
pub fn rename_symbol(&mut self, id: SymbolId, new_path: SymbolPath)
Add a symbol rename.
Sourcepub fn update_span(&mut self, id: SymbolId, new_span: FileSpan)
pub fn update_span(&mut self, id: SymbolId, new_span: FileSpan)
Add a span update.
Sourcepub fn updates(&self) -> &[RegistryUpdate]
pub fn updates(&self) -> &[RegistryUpdate]
Get the updates.
Sourcepub fn into_updates(self) -> Vec<RegistryUpdate>
pub fn into_updates(self) -> Vec<RegistryUpdate>
Consume and return the updates.
Sourcepub fn apply(self, registry: &mut SymbolRegistry) -> Result<usize, ApplyError>
pub fn apply(self, registry: &mut SymbolRegistry) -> Result<usize, ApplyError>
Apply all updates to the registry.
Updates are applied in order. If any update fails, the operation stops and returns the error. Previously applied updates are NOT rolled back (partial application).
§Returns
Ok(applied_count): Number of successfully applied updatesErr(ApplyError): First error encountered
Trait Implementations§
Source§impl Clone for RegistryUpdateBatch
impl Clone for RegistryUpdateBatch
Source§fn clone(&self) -> RegistryUpdateBatch
fn clone(&self) -> RegistryUpdateBatch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegistryUpdateBatch
impl Debug for RegistryUpdateBatch
Source§impl Default for RegistryUpdateBatch
impl Default for RegistryUpdateBatch
Source§fn default() -> RegistryUpdateBatch
fn default() -> RegistryUpdateBatch
Returns the “default value” for a type. Read more
Source§impl<'a> IntoIterator for &'a RegistryUpdateBatch
impl<'a> IntoIterator for &'a RegistryUpdateBatch
Source§impl IntoIterator for RegistryUpdateBatch
impl IntoIterator for RegistryUpdateBatch
Auto Trait Implementations§
impl Freeze for RegistryUpdateBatch
impl RefUnwindSafe for RegistryUpdateBatch
impl Send for RegistryUpdateBatch
impl Sync for RegistryUpdateBatch
impl Unpin for RegistryUpdateBatch
impl UnsafeUnpin for RegistryUpdateBatch
impl UnwindSafe for RegistryUpdateBatch
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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