fn new()

in rust/ccommon-rs/src/option/mod.rs [59:100]


    fn new(default: Self::Value, name: &'static CStr, desc: &'static CStr) -> Self;

    /// Create an option with the given description, name,
    /// and `Default::default()` as the default value.
    ///
    /// The only exception is that [`Str`](crate::option::Str)
    /// uses `std::ptr::null_mut()` as it's default value since
    /// pointers do not implement `Default`.
    ///
    /// Normally, this should only be called by the derive macro
    /// for `Options`.
    fn defaulted(name: &'static CStr, desc: &'static CStr) -> Self;

    /// The name of this option
    fn name(&self) -> &'static CStr;
    /// A C string describing this option
    fn desc(&self) -> &'static CStr;
    /// The current value of this option
    fn value(&self) -> Self::Value;
    /// The default value for this option
    fn default(&self) -> Self::Value;
    /// Whether the option has been set externally
    fn is_set(&self) -> bool;

    /// Overwrite the current value for the option.
    ///
    /// This will always set `is_set` to true.
    fn set_value(&mut self, val: Self::Value);
}

/// A type that can be safely viewed as a contiguous
/// array of [`option`s][0].
///
/// See [`OptionsExt`] for more useful functions on
/// `Options`.
///
/// This trait should normally only be implemented through
/// `#[derive(Options)]`. However, it must be implemented
/// manually for C types which have been bound using bindgen.
///
/// [0]: ../../cc_binding/struct.option.html
pub unsafe trait Options: Sized {