pub struct GriteContext {
pub git_dir: PathBuf,
pub actor_id: String,
pub actor_config: ActorConfig,
pub data_dir: PathBuf,
pub source: ActorSource,
}Expand description
Resolved context for a grite command
Fields§
§git_dir: PathBuf§actor_id: String§actor_config: ActorConfig§data_dir: PathBuf§source: ActorSourceImplementations§
Source§impl GriteContext
impl GriteContext
Sourcepub fn find_git_dir() -> Result<PathBuf, GriteError>
pub fn find_git_dir() -> Result<PathBuf, GriteError>
Find the shared git directory (commondir) for this repository.
pub fn find_git_dir_at(path: impl AsRef<Path>) -> Result<PathBuf, GriteError>
Sourcepub fn resolve(opts: &ResolveOptions) -> Result<Self, GriteError>
pub fn resolve(opts: &ResolveOptions) -> Result<Self, GriteError>
Resolve the actor context from options.
Sourcepub fn open_store(&self) -> Result<LockedStore, GriteError>
pub fn open_store(&self) -> Result<LockedStore, GriteError>
Open the store for this context with exclusive filesystem lock.
Sourcepub fn open_wal(&self) -> Result<WalManager, GitError>
pub fn open_wal(&self) -> Result<WalManager, GitError>
Open the WAL manager
Sourcepub fn open_snapshot(&self) -> Result<SnapshotManager, GitError>
pub fn open_snapshot(&self) -> Result<SnapshotManager, GitError>
Open the snapshot manager
Sourcepub fn open_sync(&self) -> Result<SyncManager, GitError>
pub fn open_sync(&self) -> Result<SyncManager, GitError>
Open the sync manager
Sourcepub fn open_lock_manager(&self) -> Result<LockManager, GitError>
pub fn open_lock_manager(&self) -> Result<LockManager, GitError>
Open the lock manager
Sourcepub fn get_lock_policy(&self) -> LockPolicy
pub fn get_lock_policy(&self) -> LockPolicy
Get the lock policy from repo config
Sourcepub fn check_lock(&self, resource: &str) -> Result<LockCheckResult, GriteError>
pub fn check_lock(&self, resource: &str) -> Result<LockCheckResult, GriteError>
Check locks for a resource before a write operation
Sourcepub fn load_signing_key(&self) -> Option<SigningKeyPair>
pub fn load_signing_key(&self) -> Option<SigningKeyPair>
Load the signing key pair for this actor (if available)
Sourcepub fn sign_event(&self, event: Event) -> Event
pub fn sign_event(&self, event: Event) -> Event
Sign an event if a signing key is available
Sourcepub fn execution_mode(&self, no_daemon: bool) -> ExecutionMode
pub fn execution_mode(&self, no_daemon: bool) -> ExecutionMode
Determine execution mode (local vs daemon)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GriteContext
impl RefUnwindSafe for GriteContext
impl Send for GriteContext
impl Sync for GriteContext
impl Unpin for GriteContext
impl UnsafeUnpin for GriteContext
impl UnwindSafe for GriteContext
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.