Replace lexical Rust fragments with real modules

This commit is contained in:
ms2k 2026-07-19 05:12:57 +09:00
commit 247819250b
2 changed files with 3302 additions and 2671 deletions

View file

@ -1,3 +1,13 @@
use super::{
CanonicalDerivedNetworkPolicy, CommittedSandboxRuntime, CoordinatorChannel,
GitRoutingCoordinator, MountIdentity, NamespaceIdentity, NetworkCoordinator,
NetworkProbeRequest, NetworkReadinessEvidence, PidfsProcessIdentityV1, PipeFlags,
PreparedArtifactId, ProcessOwnershipCommitAck, ReachabilityExpectation, RetainedProcess,
RuntimeSupervisorLaunch, SandboxCoordinator, SandboxCoordinatorError, SandboxHandoffAuthority,
StagedProcessOwnership, StateAnchorCoordinator, SupervisorEvent, child_broker,
cleanup_supervisor, current_process_identity, io, pipe_with, private_seqpacket_pair,
};
pub struct AwaitingAttachedRunsc {
supervisor: Option<RetainedProcess>,
control: Option<CoordinatorChannel>,
@ -562,4 +572,3 @@ impl Drop for AwaitingSandboxReadiness {
let _ = cleanup_supervisor(&mut self.supervisor);
}
}

View file

@ -1,9 +1,17 @@
use super::{
AttachedRunscSignal, CoordinatorChannel, Duration, GenerationId, GitRoutingCoordinator,
Instant, MountIdentity, NamespaceIdentity, NetworkReadinessEvidence, Participant,
ParticipantOwnership, ParticipantRole, ParticipantState, PidfsProcessIdentityV1,
RetainedProcess, SUPERVISOR_EXIT_TIMEOUT, SandboxCoordinator, SandboxCoordinatorError,
SandboxOwnership, Signal, StateAnchorAbsenceObservation, SupervisorEvent, child_broker, io,
};
pub struct CommittedSandboxRuntime {
generation_id: GenerationId,
supervisor: Option<RetainedProcess>,
control: CoordinatorChannel,
lifetime: Option<std::os::fd::OwnedFd>,
network_evidence: Option<NetworkReadinessEvidence>,
pub(super) generation_id: GenerationId,
pub(super) supervisor: Option<RetainedProcess>,
pub(super) control: CoordinatorChannel,
pub(super) lifetime: Option<std::os::fd::OwnedFd>,
pub(super) network_evidence: Option<NetworkReadinessEvidence>,
}
impl CommittedSandboxRuntime {
@ -250,7 +258,7 @@ impl Drop for CommittedSandboxRuntime {
}
}
fn sandbox_participant(
pub(super) fn sandbox_participant(
generation_id: GenerationId,
state: ParticipantState,
ownership: SandboxOwnership,
@ -264,14 +272,17 @@ fn sandbox_participant(
.map_err(|_| SandboxCoordinatorError::InvalidState("Sandbox participant shape is invalid"))
}
fn sandbox_role(participants: &[Participant], generation_id: GenerationId) -> Option<&Participant> {
pub(super) fn sandbox_role(
participants: &[Participant],
generation_id: GenerationId,
) -> Option<&Participant> {
participants.iter().find(|participant| {
participant.generation_id() == generation_id
&& participant.role() == ParticipantRole::Sandbox
})
}
fn cleanup_supervisor(
pub(super) fn cleanup_supervisor(
supervisor: &mut Option<RetainedProcess>,
) -> Result<(), SandboxCoordinatorError> {
let Some(process) = supervisor.take() else {
@ -306,4 +317,3 @@ fn wait_and_reap_supervisor(
child_broker().reap(process)?;
Ok(())
}