pub struct SingBoxOutboundAdapter { /* private fields */ }Expand description
CoreScope-aware outbound inventory and selector adapter.
The controller has no revision/CAS endpoint. This adapter therefore
serializes its own operations, compares a fresh /proxies observation with
the expected local revision immediately before writes, verifies the active
scope/version around HTTP calls, and accepts a write only after readback.
The probe asks the engine’s own delay endpoint for the measured latency of one outbound and reports the engine’s typed answer: a measurement, the engine’s timeout, a typed failure or the unsupported capability. The driver never invents a measurement the engine did not publish.
Implementations§
Source§impl SingBoxOutboundAdapter
impl SingBoxOutboundAdapter
Sourcepub fn new(
api: SingBoxClashApiClient,
scope_source: Arc<dyn CoreScopeSource>,
) -> Self
pub fn new( api: SingBoxClashApiClient, scope_source: Arc<dyn CoreScopeSource>, ) -> Self
Creates the outbound adapter over one API client and scope source.
Trait Implementations§
Source§impl OutboundPort for SingBoxOutboundAdapter
impl OutboundPort for SingBoxOutboundAdapter
Source§fn inventory<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
) -> Pin<Box<dyn Future<Output = Result<OutboundInventorySnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn inventory<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
) -> Pin<Box<dyn Future<Output = Result<OutboundInventorySnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reads the current outbound inventory for one scope.
Source§fn observation<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
) -> Pin<Box<dyn Future<Output = Result<OutboundObservationSnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn observation<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
) -> Pin<Box<dyn Future<Output = Result<OutboundObservationSnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read inventory and details from one adapter observation cycle where
supported. The default composes narrow reads and validates their fence.
Source§fn details<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
expected_revision: SnapshotRevision,
) -> Pin<Box<dyn Future<Output = Result<OutboundDetailsSnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn details<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
expected_revision: SnapshotRevision,
) -> Pin<Box<dyn Future<Output = Result<OutboundDetailsSnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read details for the same inventory revision observed by the caller.
Implementations that do not expose neutral details fail closed.
Source§fn select<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
expected_revision: SnapshotRevision,
collection_id: OutboundId,
outbound_id: OutboundId,
) -> Pin<Box<dyn Future<Output = Result<OutboundInventorySnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn select<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
expected_revision: SnapshotRevision,
collection_id: OutboundId,
outbound_id: OutboundId,
) -> Pin<Box<dyn Future<Output = Result<OutboundInventorySnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Select one member of one collection and return the new inventory. Read more
Source§fn probe<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
expected_revision: SnapshotRevision,
outbound_id: OutboundId,
request: OutboundProbeRequest,
) -> Pin<Box<dyn Future<Output = Result<OutboundProbeSnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn probe<'life0, 'async_trait>(
&'life0 self,
scope: CoreScope,
expected_revision: SnapshotRevision,
outbound_id: OutboundId,
request: OutboundProbeRequest,
) -> Pin<Box<dyn Future<Output = Result<OutboundProbeSnapshot, PortError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Probe one outbound and return the fenced probe snapshot. Read more
Auto Trait Implementations§
impl !Freeze for SingBoxOutboundAdapter
impl !RefUnwindSafe for SingBoxOutboundAdapter
impl !UnwindSafe for SingBoxOutboundAdapter
impl Forget for SingBoxOutboundAdapter
impl Move for SingBoxOutboundAdapter
impl Send for SingBoxOutboundAdapter
impl Sync for SingBoxOutboundAdapter
impl Unpin for SingBoxOutboundAdapter
impl UnsafeUnpin for SingBoxOutboundAdapter
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