pub struct NapiClient { /* private fields */ }Expand description
A WebTransport client that can connect to servers.
Implementations§
Source§impl NapiClient
impl NapiClient
Sourcepub fn with_system_roots() -> Result<Self>
pub fn with_system_roots() -> Result<Self>
Create a client that validates server certificates against system root CAs.
Sourcepub fn disable_verify() -> Result<Self>
pub fn disable_verify() -> Result<Self>
Create a client that skips certificate verification entirely. WARNING: Only use for testing with self-signed certificates.
Sourcepub fn with_certificate_hashes(hashes: Vec<Buffer>) -> Result<Self>
pub fn with_certificate_hashes(hashes: Vec<Buffer>) -> Result<Self>
Create a client that validates server certificates by SHA-256 hash.
Sourcepub async fn connect(&self, url_str: String) -> Result<NapiSession>
pub async fn connect(&self, url_str: String) -> Result<NapiSession>
Connect to a WebTransport server at the given URL.
Trait Implementations§
Source§impl FromNapiMutRef for NapiClient
impl FromNapiMutRef for NapiClient
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for NapiClient
impl FromNapiRef for NapiClient
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl JavaScriptClassExt for NapiClient
impl JavaScriptClassExt for NapiClient
fn into_instance<'scope>( self, env: &'scope Env, ) -> Result<ClassInstance<'scope, Self>>
fn into_reference(self, env: Env) -> Result<Reference<Self>>
fn instance_of<'env, V: JsValue<'env>>(env: &Env, value: &V) -> Result<bool>
Source§impl ToNapiValue for NapiClient
impl ToNapiValue for NapiClient
Source§unsafe fn to_napi_value(env: napi_env, val: NapiClient) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: NapiClient) -> Result<napi_value>
Safety Read more
fn into_unknown(self, env: &Env) -> Result<Unknown<'_>, Error>
Source§impl TypeName for &NapiClient
impl TypeName for &NapiClient
Source§impl TypeName for &mut NapiClient
impl TypeName for &mut NapiClient
Source§impl TypeName for NapiClient
impl TypeName for NapiClient
Source§impl ValidateNapiValue for &NapiClient
impl ValidateNapiValue for &NapiClient
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut NapiClient
impl ValidateNapiValue for &mut NapiClient
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for NapiClient
impl !RefUnwindSafe for NapiClient
impl Send for NapiClient
impl Sync for NapiClient
impl Unpin for NapiClient
impl UnsafeUnpin for NapiClient
impl !UnwindSafe for NapiClient
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