pub struct ObsString { /* private fields */ }Expand description
String wrapper for OBS function calls.
ObsString provides safe interaction with OBS C API functions that require
C-style strings. It wraps CString internally with convenient helper functions
for converting between Rust strings and C-compatible strings.
§Safety
- Any NUL byte in input strings is stripped during conversion to prevent panicking
- Memory is properly managed to prevent use-after-free and memory leaks
- Automatically handles conversion between Rust’s UTF-8 strings and C’s NUL-terminated strings
§Examples
use libobs_wrapper::utils::ObsString;
// Create an ObsString from a Rust string
let obs_string = ObsString::new("Hello, OBS!");
assert_eq!(obs_string.as_c_str().to_bytes(), b"Hello, OBS!");Implementations§
Source§impl ObsString
impl ObsString
Trait Implementations§
impl Eq for ObsString
Source§impl From<ObsAudioEncoderType> for ObsString
impl From<ObsAudioEncoderType> for ObsString
Source§fn from(v: ObsAudioEncoderType) -> ObsString
fn from(v: ObsAudioEncoderType) -> ObsString
Converts to this type from the input type.
Source§impl From<ObsVideoEncoderType> for ObsString
impl From<ObsVideoEncoderType> for ObsString
Source§fn from(v: ObsVideoEncoderType) -> ObsString
fn from(v: ObsVideoEncoderType) -> ObsString
Converts to this type from the input type.
Source§impl Ord for ObsString
impl Ord for ObsString
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq<&str> for ObsString
impl PartialEq<&str> for ObsString
Source§impl PartialOrd for ObsString
impl PartialOrd for ObsString
impl StructuralPartialEq for ObsString
Auto Trait Implementations§
impl Freeze for ObsString
impl RefUnwindSafe for ObsString
impl Send for ObsString
impl Sync for ObsString
impl Unpin for ObsString
impl UnsafeUnpin for ObsString
impl UnwindSafe for ObsString
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