docs(connector): update documents

This commit is contained in:
0x676e67 2025-06-21 19:54:17 +08:00
parent 590cef9b1f
commit 3a32ea51f7
1 changed files with 1 additions and 41 deletions

View File

@ -266,14 +266,6 @@ impl ConnectConfiguration {
impl ConnectConfiguration { impl ConnectConfiguration {
/// Enables or disables ECH grease. /// Enables or disables ECH grease.
///
/// # Arguments
///
/// * `enable` - A boolean indicating whether to enable ECH grease.
///
/// # Safety
///
/// This function is unsafe because it calls an FFI function.
#[cfg(not(feature = "fips"))] #[cfg(not(feature = "fips"))]
#[corresponds(SSL_set_enable_ech_grease)] #[corresponds(SSL_set_enable_ech_grease)]
pub fn set_enable_ech_grease(&mut self, enable: bool) { pub fn set_enable_ech_grease(&mut self, enable: bool) {
@ -298,19 +290,7 @@ impl ConnectConfiguration {
unsafe { ffi::SSL_set_prefer_chacha20(self.as_ptr(), enable as _) } unsafe { ffi::SSL_set_prefer_chacha20(self.as_ptr(), enable as _) }
} }
/// Adds application settings. /// Sets application settings flag for ALPS (Application-Layer Protocol Negotiation).
///
/// # Arguments
///
/// * `alps` - A slice of bytes representing the application settings.
///
/// # Returns
///
/// * `Result<(), ErrorStack>` - Returns `Ok(())` if the operation is successful, otherwise returns an `ErrorStack`.
///
/// # Safety
///
/// This function is unsafe because it calls an FFI function.
#[corresponds(SSL_add_application_settings)] #[corresponds(SSL_add_application_settings)]
pub fn add_application_settings(&mut self, alps: &[u8]) -> Result<(), ErrorStack> { pub fn add_application_settings(&mut self, alps: &[u8]) -> Result<(), ErrorStack> {
unsafe { unsafe {
@ -326,32 +306,12 @@ impl ConnectConfiguration {
} }
/// Sets the ALPS use new codepoint flag. /// Sets the ALPS use new codepoint flag.
///
/// # Arguments
///
/// * `use_new` - A boolean indicating whether to use the new codepoint.
///
/// # Safety
///
/// This function is unsafe because it calls an FFI function.
#[corresponds(SSL_set_alps_use_new_codepoint)] #[corresponds(SSL_set_alps_use_new_codepoint)]
pub fn set_alps_use_new_codepoint(&mut self, use_new: bool) { pub fn set_alps_use_new_codepoint(&mut self, use_new: bool) {
unsafe { ffi::SSL_set_alps_use_new_codepoint(self.as_ptr(), use_new as _) } unsafe { ffi::SSL_set_alps_use_new_codepoint(self.as_ptr(), use_new as _) }
} }
/// Sets the SSL options. /// Sets the SSL options.
///
/// # Arguments
///
/// * `options` - An `SslOptions` bitmask representing the options to set.
///
/// # Returns
///
/// * `Result<(), ErrorStack>` - Returns `Ok(())` if the operation is successful, otherwise returns an `ErrorStack`.
///
/// # Safety
///
/// This function is unsafe because it calls an FFI function.
#[corresponds(SSL_set_options)] #[corresponds(SSL_set_options)]
pub fn set_options(&mut self, options: SslOptions) -> Result<(), ErrorStack> { pub fn set_options(&mut self, options: SslOptions) -> Result<(), ErrorStack> {
unsafe { cvt(ffi::SSL_set_options(self.as_ptr(), options.bits()) as _).map(|_| ()) } unsafe { cvt(ffi::SSL_set_options(self.as_ptr(), options.bits()) as _).map(|_| ()) }