Skip to main content

CapabilityHandler

Struct CapabilityHandler 

Source
pub struct CapabilityHandler { /* private fields */ }
Expand description

Manages IRCv3 capability negotiation

Implementations§

Source§

impl CapabilityHandler

Source

pub fn new() -> Self

Create a new capability handler

Source

pub fn set_version(&mut self, version: u16)

Set the CAP version to use

Source

pub fn handle_cap_ls(&mut self, params: &[String]) -> Result<bool>

Handle CAP LS response

Source

pub fn handle_cap_ack(&mut self, caps: &[String]) -> Result<()>

Handle CAP ACK response

Source

pub fn handle_cap_nak(&mut self, caps: &[String]) -> Result<()>

Handle CAP NAK response

Source

pub fn handle_cap_new(&mut self, caps_str: &str) -> Result<Vec<String>>

Handle CAP NEW notification (IRCv3.2+)

Source

pub fn handle_cap_del(&mut self, caps: &[String]) -> Result<()>

Handle CAP DEL notification (IRCv3.2+)

Source

pub fn get_capabilities_to_request(&self) -> Vec<String>

Get capabilities to request based on what’s available

Source

pub fn is_capability_enabled(&self, cap_name: &str) -> bool

Check if a capability is enabled

Source

pub fn get_sasl_mechanisms(&self) -> Vec<String>

Get available SASL mechanisms

Source

pub fn set_negotiation_complete(&mut self)

Mark capability negotiation as complete

Source

pub fn is_negotiation_complete(&self) -> bool

Check if capability negotiation is complete

Source

pub fn handle_sts_policy( &mut self, hostname: &str, cap_value: &str, ) -> Result<()>

Handle STS policy

Source

pub fn should_upgrade_to_tls(&self, hostname: &str) -> Option<u16>

Check if we should upgrade to TLS for a hostname

Source

pub fn get_essential_capabilities(&self) -> Vec<&str>

Get essential capabilities list

Trait Implementations§

Source§

impl Default for CapabilityHandler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V