Skip to main content

ProxyCore

Trait ProxyCore 

Source
pub trait ProxyCore: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn is_installed<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn install<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn active_profile<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn switch_profile<'life0, 'life1, 'async_trait>(
        &'life0 self,
        outbound_tag: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn reload<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn start_benchmark_session<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _outbound_tags: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn BenchmarkSession>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Abstraction over a proxy runtime core (e.g. Xray, sing-box).

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn is_installed<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn install<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn active_profile<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn switch_profile<'life0, 'life1, 'async_trait>( &'life0 self, outbound_tag: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn reload<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn start_benchmark_session<'life0, 'life1, 'async_trait>( &'life0 self, _outbound_tags: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn BenchmarkSession>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Optionally start an isolated, non-disruptive benchmark session exposing a dedicated local proxy endpoint for each requested outbound tag. Returning Ok(None) falls back to sequential switch+reload benchmarking.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§