summaryrefslogtreecommitdiff
path: root/rust/src/websocket
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-05 13:17:30 -0400
committerMason Reed <35282038+emesare@users.noreply.github.com>2025-05-12 17:45:24 -0400
commit9dadf92c16da5cd21def79ae39ca98803c9208ec (patch)
tree3874a659bcb3818f43c1a46ab3ef081b99b47154 /rust/src/websocket
parent9f5491a56f6af1fa9b030f23d40150673a52aaa1 (diff)
[Rust] Rename `AsCStr` to `IntoCStr`
Diffstat (limited to 'rust/src/websocket')
-rw-r--r--rust/src/websocket/client.rs10
-rw-r--r--rust/src/websocket/provider.rs4
2 files changed, 7 insertions, 7 deletions
diff --git a/rust/src/websocket/client.rs b/rust/src/websocket/client.rs
index 8e2c6db0..aa69c381 100644
--- a/rust/src/websocket/client.rs
+++ b/rust/src/websocket/client.rs
@@ -1,5 +1,5 @@
use crate::rc::{Ref, RefCountable};
-use crate::string::{AsCStr, BnString};
+use crate::string::{BnString, IntoCStr};
use binaryninjacore_sys::*;
use std::ffi::{c_char, c_void, CStr};
use std::ptr::NonNull;
@@ -21,8 +21,8 @@ pub trait WebsocketClient: Sync + Send {
fn connect<I, K, V>(&self, host: &str, headers: I) -> bool
where
I: IntoIterator<Item = (K, V)>,
- K: AsCStr,
- V: AsCStr;
+ K: IntoCStr,
+ V: IntoCStr;
fn write(&self, data: &[u8]) -> bool;
@@ -77,8 +77,8 @@ impl CoreWebsocketClient {
) -> bool
where
I: IntoIterator<Item = (K, V)>,
- K: AsCStr,
- V: AsCStr,
+ K: IntoCStr,
+ V: IntoCStr,
C: WebsocketClientCallback,
{
let url = host.to_cstr();
diff --git a/rust/src/websocket/provider.rs b/rust/src/websocket/provider.rs
index 9cc1de84..40235c2b 100644
--- a/rust/src/websocket/provider.rs
+++ b/rust/src/websocket/provider.rs
@@ -1,5 +1,5 @@
use crate::rc::{Array, CoreArrayProvider, CoreArrayProviderInner, Ref};
-use crate::string::{AsCStr, BnString};
+use crate::string::{BnString, IntoCStr};
use crate::websocket::client;
use crate::websocket::client::{CoreWebsocketClient, WebsocketClient};
use binaryninjacore_sys::*;
@@ -80,7 +80,7 @@ impl CoreWebsocketProvider {
unsafe { Array::new(result, count, ()) }
}
- pub fn by_name<S: AsCStr>(name: S) -> Option<CoreWebsocketProvider> {
+ pub fn by_name<S: IntoCStr>(name: S) -> Option<CoreWebsocketProvider> {
let name = name.to_cstr();
let result = unsafe { BNGetWebsocketProviderByName(name.as_ptr()) };
NonNull::new(result).map(|h| unsafe { Self::from_raw(h) })