pub struct ChangeLog { /* private fields */ }Expand description
Append-only writer for one plugin invocation’s records.
Implementations§
Source§impl ChangeLog
impl ChangeLog
Sourcepub fn open(project_root: &Path, plugin: &str) -> Result<Self>
pub fn open(project_root: &Path, plugin: &str) -> Result<Self>
Open (creating) the JSONL file for this plugin invocation.
File path: <project_root>/.ready-set/changes/<plugin>-<rfc3339>-<rand4>.jsonl.
§Errors
Returns Error::Io if the directory cannot be created or the file
cannot be opened, or Error::Other if randomness collection fails.
Sourcepub fn project_root(&self) -> &Path
pub fn project_root(&self) -> &Path
Project root associated with this log.
Sourcepub fn record(&mut self, record: &ChangeRecord) -> Result<()>
pub fn record(&mut self, record: &ChangeRecord) -> Result<()>
Append a record. Each record is fsynced before the call returns.
§Errors
Returns Error::Io on a write or fsync failure or
Error::JsonParse if the record cannot be serialized.
Auto Trait Implementations§
impl Freeze for ChangeLog
impl RefUnwindSafe for ChangeLog
impl Send for ChangeLog
impl Sync for ChangeLog
impl Unpin for ChangeLog
impl UnsafeUnpin for ChangeLog
impl UnwindSafe for ChangeLog
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 more