pub struct CapabilityHandler { /* private fields */ }Expand description
Manages IRCv3 capability negotiation
Implementations§
Source§impl CapabilityHandler
impl CapabilityHandler
Sourcepub fn set_version(&mut self, version: u16)
pub fn set_version(&mut self, version: u16)
Set the CAP version to use
Sourcepub fn handle_cap_ls(&mut self, params: &[String]) -> Result<bool>
pub fn handle_cap_ls(&mut self, params: &[String]) -> Result<bool>
Handle CAP LS response
Sourcepub fn handle_cap_ack(&mut self, caps: &[String]) -> Result<()>
pub fn handle_cap_ack(&mut self, caps: &[String]) -> Result<()>
Handle CAP ACK response
Sourcepub fn handle_cap_nak(&mut self, caps: &[String]) -> Result<()>
pub fn handle_cap_nak(&mut self, caps: &[String]) -> Result<()>
Handle CAP NAK response
Sourcepub fn handle_cap_new(&mut self, caps_str: &str) -> Result<Vec<String>>
pub fn handle_cap_new(&mut self, caps_str: &str) -> Result<Vec<String>>
Handle CAP NEW notification (IRCv3.2+)
Sourcepub fn handle_cap_del(&mut self, caps: &[String]) -> Result<()>
pub fn handle_cap_del(&mut self, caps: &[String]) -> Result<()>
Handle CAP DEL notification (IRCv3.2+)
Sourcepub fn get_capabilities_to_request(&self) -> Vec<String>
pub fn get_capabilities_to_request(&self) -> Vec<String>
Get capabilities to request based on what’s available
Sourcepub fn is_capability_enabled(&self, cap_name: &str) -> bool
pub fn is_capability_enabled(&self, cap_name: &str) -> bool
Check if a capability is enabled
Sourcepub fn get_sasl_mechanisms(&self) -> Vec<String>
pub fn get_sasl_mechanisms(&self) -> Vec<String>
Get available SASL mechanisms
Sourcepub fn set_negotiation_complete(&mut self)
pub fn set_negotiation_complete(&mut self)
Mark capability negotiation as complete
Sourcepub fn is_negotiation_complete(&self) -> bool
pub fn is_negotiation_complete(&self) -> bool
Check if capability negotiation is complete
Sourcepub fn handle_sts_policy(
&mut self,
hostname: &str,
cap_value: &str,
) -> Result<()>
pub fn handle_sts_policy( &mut self, hostname: &str, cap_value: &str, ) -> Result<()>
Handle STS policy
Sourcepub fn should_upgrade_to_tls(&self, hostname: &str) -> Option<u16>
pub fn should_upgrade_to_tls(&self, hostname: &str) -> Option<u16>
Check if we should upgrade to TLS for a hostname
Sourcepub fn get_essential_capabilities(&self) -> Vec<&str>
pub fn get_essential_capabilities(&self) -> Vec<&str>
Get essential capabilities list
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CapabilityHandler
impl RefUnwindSafe for CapabilityHandler
impl Send for CapabilityHandler
impl Sync for CapabilityHandler
impl Unpin for CapabilityHandler
impl UnsafeUnpin for CapabilityHandler
impl UnwindSafe for CapabilityHandler
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