pub struct SingBoxControllerConfiguration { /* private fields */ }Expand description
The validated loopback controller configuration of a sing-box profile.
Implementations§
Source§impl SingBoxControllerConfiguration
impl SingBoxControllerConfiguration
Sourcepub fn from_profile_json(
raw_bytes: &[u8],
) -> Result<Self, SingBoxControllerConfigurationError>
pub fn from_profile_json( raw_bytes: &[u8], ) -> Result<Self, SingBoxControllerConfigurationError>
Reads the controller configuration out of a sing-box profile.
The profile must enable the experimental Clash API, bind the external controller to loopback and use a fixed, non-zero port.
Sourcepub fn address(&self) -> SocketAddr
pub fn address(&self) -> SocketAddr
Returns the socket address the controller binds to.
Sourcepub fn endpoint(&self) -> String
pub fn endpoint(&self) -> String
Returns the explicit HTTP loopback endpoint of the controller.
Returns the authorization the controller expects.
Trait Implementations§
impl Eq for SingBoxControllerConfiguration
impl StructuralPartialEq for SingBoxControllerConfiguration
Auto Trait Implementations§
impl Forget for SingBoxControllerConfiguration
impl Freeze for SingBoxControllerConfiguration
impl Move for SingBoxControllerConfiguration
impl RefUnwindSafe for SingBoxControllerConfiguration
impl Send for SingBoxControllerConfiguration
impl Sync for SingBoxControllerConfiguration
impl Unpin for SingBoxControllerConfiguration
impl UnsafeUnpin for SingBoxControllerConfiguration
impl UnwindSafe for SingBoxControllerConfiguration
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.