aravis/auto/
flags.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from ../gir-files
3// DO NOT EDIT
4
5use crate::ffi;
6use glib::{bitflags::bitflags, prelude::*, translate::*};
7
8bitflags! {
9	#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
10	#[doc(alias = "ArvGvStreamOption")]
11	pub struct GvStreamOption: u32 {
12		#[doc(alias = "ARV_GV_STREAM_OPTION_NONE")]
13		const NONE = ffi::ARV_GV_STREAM_OPTION_NONE as _;
14		#[doc(alias = "ARV_GV_STREAM_OPTION_PACKET_SOCKET_DISABLED")]
15		const PACKET_SOCKET_DISABLED = ffi::ARV_GV_STREAM_OPTION_PACKET_SOCKET_DISABLED as _;
16	}
17}
18
19#[doc(hidden)]
20impl IntoGlib for GvStreamOption {
21	type GlibType = ffi::ArvGvStreamOption;
22
23	#[inline]
24	fn into_glib(self) -> ffi::ArvGvStreamOption {
25		self.bits()
26	}
27}
28
29#[doc(hidden)]
30impl FromGlib<ffi::ArvGvStreamOption> for GvStreamOption {
31	#[inline]
32	unsafe fn from_glib(value: ffi::ArvGvStreamOption) -> Self {
33		skip_assert_initialized!();
34		Self::from_bits_truncate(value)
35	}
36}
37
38impl StaticType for GvStreamOption {
39	#[inline]
40	#[doc(alias = "arv_gv_stream_option_get_type")]
41	fn static_type() -> glib::Type {
42		unsafe { from_glib(ffi::arv_gv_stream_option_get_type()) }
43	}
44}
45
46impl glib::HasParamSpec for GvStreamOption {
47	type ParamSpec = glib::ParamSpecFlags;
48	type SetValue = Self;
49	type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
50
51	fn param_spec_builder() -> Self::BuilderFn {
52		Self::ParamSpec::builder
53	}
54}
55
56impl glib::value::ValueType for GvStreamOption {
57	type Type = Self;
58}
59
60unsafe impl<'a> glib::value::FromValue<'a> for GvStreamOption {
61	type Checker = glib::value::GenericValueTypeChecker<Self>;
62
63	#[inline]
64	unsafe fn from_value(value: &'a glib::Value) -> Self {
65		skip_assert_initialized!();
66		from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
67	}
68}
69
70impl ToValue for GvStreamOption {
71	#[inline]
72	fn to_value(&self) -> glib::Value {
73		let mut value = glib::Value::for_value_type::<Self>();
74		unsafe {
75			glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
76		}
77		value
78	}
79
80	#[inline]
81	fn value_type(&self) -> glib::Type {
82		Self::static_type()
83	}
84}
85
86impl From<GvStreamOption> for glib::Value {
87	#[inline]
88	fn from(v: GvStreamOption) -> Self {
89		skip_assert_initialized!();
90		ToValue::to_value(&v)
91	}
92}