1#![allow(non_camel_case_types)]
14#![allow(non_upper_case_globals)]
15#![allow(unused)]
16#![allow(missing_debug_implementations)]
17#![allow(missing_docs)]
18
19use crate::mut_override;
20
21include!("bindings.rs");
22
23impl Default for RiceStreamIncomingData {
24 fn default() -> Self {
25 Self {
26 handled: false,
27 have_more_data: false,
28 data: RiceDataImpl {
29 ptr: core::ptr::null_mut(),
30 size: 0,
31 },
32 }
33 }
34}
35
36impl RiceDataImpl {
37 pub(crate) fn to_c(slice: &[u8]) -> Self {
38 Self {
39 ptr: mut_override(slice.as_ptr()),
40 size: slice.len(),
41 }
42 }
43}
44
45impl RiceData {
46 pub(crate) fn to_c_owned(slice: &[u8]) -> Self {
47 RiceData {
48 tag: RICE_DATA_OWNED,
49 field1: RiceData__bindgen_ty_1 {
50 field2: core::mem::ManuallyDrop::new(RiceData__bindgen_ty_1__bindgen_ty_2 {
51 owned: RiceDataImpl::to_c(slice),
52 }),
53 },
54 }
55 }
56}
57
58impl RiceGatheredCandidate {
59 pub(crate) unsafe fn zeroed() -> Self {
60 unsafe {
61 RiceGatheredCandidate {
62 candidate: RiceCandidate::zeroed(),
63 turn_agent: core::ptr::null_mut(),
64 }
65 }
66 }
67}
68
69impl RiceCandidate {
70 pub(crate) unsafe fn zeroed() -> Self {
71 RiceCandidate {
72 component_id: 1,
73 candidate_type: RICE_CANDIDATE_TYPE_HOST,
74 transport_type: RICE_TRANSPORT_TYPE_UDP,
75 foundation: core::ptr::null_mut(),
76 priority: 0,
77 address: core::ptr::null(),
78 base_address: core::ptr::null(),
79 related_address: core::ptr::null(),
80 tcp_type: RICE_TCP_TYPE_NONE,
81 extensions: core::ptr::null_mut(),
82 extensions_len: 0,
83 }
84 }
85}