properties: NACodecTypeInfo::None,
extradata: None };
+/// Option definition.
+#[derive(Debug)]
+pub struct NAOptionDefinition {
+ /// Option name.
+ pub name: &'static str,
+ /// Option meaning.
+ pub description: &'static str,
+ /// Minimal value for the option (if applicable).
+ pub min_value: Option<NAValue>,
+ /// Maximum value for the option (if applicable).
+ pub max_value: Option<NAValue>,
+}
+
+/// Option.
+#[derive(Clone,Debug,PartialEq)]
+pub struct NAOption {
+ /// Option name.
+ pub name: String,
+ /// Option value.
+ pub value: NAValue,
+}
+
/// A list of accepted option values.
-#[derive(Debug,Clone)]
+#[derive(Debug,Clone,PartialEq)]
pub enum NAValue {
/// Empty value.
None,
+ /// Boolean value.
+ Bool(bool),
/// Integer value.
Int(i32),
/// Long integer value.
Long(i64),
+ /// Floating point value.
+ Float(f32),
/// String value.
String(String),
/// Binary data value.
pub fn get_buffer(&self) -> NABufferRef<Vec<u8>> { self.buffer.clone() }
/// Adds side data for a packet.
pub fn add_side_data(&mut self, side_data: NASideData) { self.side_data.push(side_data); }
+ /// Assigns packet to a new stream.
+ pub fn reassign(&mut self, str: NAStreamRef, ts: NATimeInfo) {
+ self.stream = str;
+ self.ts = ts;
+ }
}
impl Drop for NAPacket {