pub struct MetadataIoActor { /* private fields */ }Expand description
A cloneable handle to the bounded metadata I/O owner.
Implementations§
Source§impl MetadataIoActor
impl MetadataIoActor
Sourcepub fn submit(
&self,
request: MetadataWriteRequest,
deadline: MetadataDeadline,
) -> RuntimeResult<MetadataIoAdmissionOutcome>
pub fn submit( &self, request: MetadataWriteRequest, deadline: MetadataDeadline, ) -> RuntimeResult<MetadataIoAdmissionOutcome>
Attempts to admit one immutable snapshot without waiting for disk durability.
The call is deliberately non-blocking. Queue or byte saturation is returned immediately and the absolute deadline is checked before admission.
Returns a normal MetadataIoAdmissionOutcome::TargetConflict when
the same resource already has pending work for a different target.
§Errors
Returns a typed deadline, capacity, or lifecycle failure.
Sourcepub fn submit_next(
&self,
resource: impl Into<Arc<str>>,
target: impl Into<PathBuf>,
bytes: impl Into<Vec<u8>>,
deadline: MetadataDeadline,
) -> RuntimeResult<MetadataIoAdmissionOutcome>
pub fn submit_next( &self, resource: impl Into<Arc<str>>, target: impl Into<PathBuf>, bytes: impl Into<Vec<u8>>, deadline: MetadataDeadline, ) -> RuntimeResult<MetadataIoAdmissionOutcome>
Assigns the next owner-lifetime generation and accepts an immutable snapshot without waiting for durability.
Generation values are unique across every metadata actor that shares this runtime owner, so a generation stays a usable change identity after an actor is replaced. Gaps are allowed when admission rejects a request; they do not weaken ordering.
§Errors
Returns the same normal outcome and typed failures as Self::submit.
Sourcepub async fn submit_durable(
&self,
request: MetadataWriteRequest,
deadline: MetadataDeadline,
) -> RuntimeResult<MetadataIoDurabilityOutcome>
pub async fn submit_durable( &self, request: MetadataWriteRequest, deadline: MetadataDeadline, ) -> RuntimeResult<MetadataIoDurabilityOutcome>
Accepts a snapshot and waits for durable completion using the same absolute deadline.
Returns MetadataIoDurabilityOutcome::TargetConflict without
starting I/O when a pending request owns a different target path.
§Errors
Returns a typed admission, persistence, worker, or deadline failure.
Sourcepub async fn submit_commit(
&self,
request: MetadataWriteRequest,
deadline: MetadataDeadline,
) -> RuntimeResult<MetadataIoCommitAdmissionOutcome>
pub async fn submit_commit( &self, request: MetadataWriteRequest, deadline: MetadataDeadline, ) -> RuntimeResult<MetadataIoCommitAdmissionOutcome>
Accepts a snapshot and returns its real persistence conclusion.
This distinguishes a failure before target replacement from an unconfirmed replacement followed by a parent-directory sync failure.
Sourcepub async fn submit_next_durable(
&self,
resource: impl Into<Arc<str>>,
target: impl Into<PathBuf>,
bytes: impl Into<Vec<u8>>,
deadline: MetadataDeadline,
) -> RuntimeResult<MetadataIoDurabilityOutcome>
pub async fn submit_next_durable( &self, resource: impl Into<Arc<str>>, target: impl Into<PathBuf>, bytes: impl Into<Vec<u8>>, deadline: MetadataDeadline, ) -> RuntimeResult<MetadataIoDurabilityOutcome>
Assigns the next process-lifetime generation, accepts the immutable snapshot, and waits for durable completion using one absolute deadline.
§Errors
Returns the same normal outcome and typed failures as
Self::submit_durable.
Sourcepub async fn submit_next_commit(
&self,
resource: impl Into<Arc<str>>,
target: impl Into<PathBuf>,
bytes: impl Into<Vec<u8>>,
deadline: MetadataDeadline,
) -> RuntimeResult<MetadataIoCommitAdmissionOutcome>
pub async fn submit_next_commit( &self, resource: impl Into<Arc<str>>, target: impl Into<PathBuf>, bytes: impl Into<Vec<u8>>, deadline: MetadataDeadline, ) -> RuntimeResult<MetadataIoCommitAdmissionOutcome>
Assigns the next owner-lifetime generation and returns its real persistence conclusion.
Sourcepub async fn submit_observed(
&self,
request: MetadataWriteRequest,
deadline: MetadataDeadline,
) -> RuntimeResult<MetadataIoCommitObservation>
pub async fn submit_observed( &self, request: MetadataWriteRequest, deadline: MetadataDeadline, ) -> RuntimeResult<MetadataIoCommitObservation>
Accepts a snapshot and reports what the caller actually confirmed about its persistence.
An Err result means the request was never admitted, so the caller may
safely discard its change. Every other case is expressed as a
MetadataIoCommitObservation, including an expiry that leaves the
change unconfirmed.
§Errors
Returns a typed admission, capacity, or lifecycle failure.
Sourcepub async fn submit_next_observed(
&self,
resource: impl Into<Arc<str>>,
target: impl Into<PathBuf>,
bytes: impl Into<Vec<u8>>,
deadline: MetadataDeadline,
) -> RuntimeResult<MetadataIoCommitObservation>
pub async fn submit_next_observed( &self, resource: impl Into<Arc<str>>, target: impl Into<PathBuf>, bytes: impl Into<Vec<u8>>, deadline: MetadataDeadline, ) -> RuntimeResult<MetadataIoCommitObservation>
Assigns the next owner-lifetime generation and reports what the caller actually confirmed about its persistence.
§Errors
Returns the same normal outcome and typed failures as
Self::submit_observed.
Sourcepub fn confirmed_durable_generation(
&self,
resource: &str,
) -> Option<MetadataGeneration>
pub fn confirmed_durable_generation( &self, resource: &str, ) -> Option<MetadataGeneration>
Returns the highest generation this actor confirmed durable for one logical resource.
This is the evidence a caller needs to resolve an earlier
MetadataIoCommitObservation::Unobserved conclusion without holding
completion history: when the value reaches the unobserved generation,
the change is durable after all. The value is seeded from the
owner-scoped target registration, so it survives actor replacement for
the same resource and target. After explicit retirement, compare
Self::target_identity with the receipt’s identity first: generations
from a different history are not evidence about the old write.
Sourcepub async fn shutdown_until(
&self,
deadline: MetadataDeadline,
) -> MetadataIoShutdownReport
pub async fn shutdown_until( &self, deadline: MetadataDeadline, ) -> MetadataIoShutdownReport
Stops new admission and drains accepted work until the absolute deadline.
Sourcepub fn stop_admission(&self)
pub fn stop_admission(&self)
Rejects future submissions while allowing accepted work to drain.
Sourcepub fn snapshot(&self) -> MetadataIoSnapshot
pub fn snapshot(&self) -> MetadataIoSnapshot
Returns current queue, byte, generation, and waiter state.
Sourcepub fn observer(&self) -> MetadataIoObserver
pub fn observer(&self) -> MetadataIoObserver
Creates a diagnostic observer without retaining write authority.
Sourcepub fn target_identity(&self, resource: &str) -> Option<MetadataTargetIdentity>
pub fn target_identity(&self, resource: &str) -> Option<MetadataTargetIdentity>
Returns the target history associated with this actor’s resource state.
Sourcepub fn retire_target_for_new_identity(
&self,
resource: &str,
) -> RuntimeResult<MetadataTargetRetirementOutcome>
pub fn retire_target_for_new_identity( &self, resource: &str, ) -> RuntimeResult<MetadataTargetRetirementOutcome>
Ends a closed, drained resource’s durable history to reclaim registry capacity.
This is an explicit identity boundary, not ordinary actor replacement. Future actors acquire a new identity and may bind a different resource to the path. Old actors cannot resume that history; retained read-only receipts keep their original result and identity. Compare generations only within the same identity.
Unconfirmed replacements retain their fence. The runtime cannot verify business file formats and does not offer unconditional fence clearing.
§Errors
Returns a typed path normalization error without modifying the history.
Sourcepub fn effective_profile(&self) -> MetadataIoEffectiveProfile
pub fn effective_profile(&self) -> MetadataIoEffectiveProfile
Returns the metadata I/O limits that are actually in force.
The view is read-only and derived from the validated configuration and the root blocking lane policy captured at startup, so it reports the values that drive execution rather than the values a caller requested.