Skip to main content

libobs/
lib.rs

1#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
2#![allow(
3    unknown_lints,
4    non_camel_case_types,
5    non_upper_case_globals,
6    unnecessary_transmutes,
7    non_snake_case,
8    no_unqualified_libobs_uses,
9    ensure_obs_call_in_runtime,
10    require_safety_comments_on_unsafe,
11    clippy::all
12)]
13
14//! # LibOBS bindings (and wrapper) for rust
15//! This crate provides bindings to the [LibOBS](https://obsproject.com/) library for rust.
16//! Furthermore, this crate provides a safe wrapper around the unsafe functions, which can be found in the [`libobs-wrapper`](https://crates.io/crates/libobs-wrapper) crate.
17
18#[cfg_attr(coverage_nightly, coverage(off))]
19// Bindgen emits libc declarations whose ABI-equivalent C integer types are not
20// written as Rust's `usize`; newer Rust versions lint those names as potential
21// runtime symbol overrides. These declarations are generated, not exports.
22#[allow(suspicious_runtime_symbol_definitions)]
23mod bindings {
24    #[cfg(any(feature = "generate_bindings", target_family = "unix"))]
25    include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
26
27    #[cfg(all(not(feature = "generate_bindings"), target_family = "windows"))]
28    include!("bindings_win.rs");
29}
30
31pub use bindings::*;
32
33/// Exact OBS Studio/libobs version represented by the vendored headers.
34pub const SUPPORTED_OBS_VERSION: &str = include_str!("../OBS_VERSION");