pub struct IndexManager { /* private fields */ }Expand description
Index manager for atomic updates with file locking
Implementations§
Source§impl IndexManager
impl IndexManager
Sourcepub fn atomic_update(
&self,
skill_id: &str,
version: &str,
entry: &VersionEntry,
) -> Result<(), ServiceError>
pub fn atomic_update( &self, skill_id: &str, version: &str, entry: &VersionEntry, ) -> Result<(), ServiceError>
Atomically update the index file for a skill version
This method:
- Normalizes the skill_id using ScopedSkillName::normalize()
- Checks for duplicate versions
- Acquires an exclusive file lock with timeout
- Reads existing entries
- Appends new entry
- Writes to temporary file
- Atomically renames temporary file to target
- Releases lock
§Arguments
skill_id- The skill identifier (may be scoped, e.g.,@org/package)version- The version string (e.g.,1.0.0)entry- The version entry to add to the index
§Returns
Ok(()) if successful, Err(ServiceError) if operation fails
§Errors
- Returns
ServiceError::Customif duplicate version is detected - Returns
ServiceError::Customif lock timeout is exceeded - Returns
ServiceError::Iofor filesystem errors
Auto Trait Implementations§
impl !Freeze for IndexManager
impl RefUnwindSafe for IndexManager
impl Send for IndexManager
impl Sync for IndexManager
impl Unpin for IndexManager
impl UnsafeUnpin for IndexManager
impl UnwindSafe for IndexManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreCreates a shared type from an unshared type.