Trait DataType

Source
pub unsafe trait DataType {
    type Type: ToOwned + ?Sized;

    // Required methods
    unsafe fn set(attr: &mut AttrValue, val: &Self::Type) -> Result<()>;
    unsafe fn get(attr: AttrValue) -> Result<<Self::Type as ToOwned>::Owned>;
}
Expand description

A trait to get and set OCI attributes as rust types. You have no need to use this except implementing OciAttr for your type.

Required Associated Types§

Required Methods§

Source

unsafe fn set(attr: &mut AttrValue, val: &Self::Type) -> Result<()>

Source

unsafe fn get(attr: AttrValue) -> Result<<Self::Type as ToOwned>::Owned>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl DataType for bool

Source§

type Type = bool

Source§

unsafe fn set(attr: &mut AttrValue, val: &bool) -> Result<()>

Source§

unsafe fn get(attr: AttrValue) -> Result<bool>

Source§

impl DataType for *mut c_void

Source§

type Type = *mut c_void

Source§

unsafe fn set(attr: &mut AttrValue, val: &*mut c_void) -> Result<()>

Source§

unsafe fn get(attr: AttrValue) -> Result<*mut c_void>

Source§

impl DataType for str

Source§

type Type = str

Source§

unsafe fn set(attr: &mut AttrValue, val: &str) -> Result<()>

Source§

unsafe fn get(attr: AttrValue) -> Result<String>

Source§

impl DataType for u8

Source§

type Type = u8

Source§

unsafe fn set(attr: &mut AttrValue, val: &u8) -> Result<()>

Source§

unsafe fn get(attr: AttrValue) -> Result<u8>

Source§

impl DataType for u16

Source§

type Type = u16

Source§

unsafe fn set(attr: &mut AttrValue, val: &u16) -> Result<()>

Source§

unsafe fn get(attr: AttrValue) -> Result<u16>

Source§

impl DataType for u32

Source§

type Type = u32

Source§

unsafe fn set(attr: &mut AttrValue, val: &u32) -> Result<()>

Source§

unsafe fn get(attr: AttrValue) -> Result<u32>

Source§

impl DataType for u64

Source§

type Type = u64

Source§

unsafe fn set(attr: &mut AttrValue, val: &u64) -> Result<()>

Source§

unsafe fn get(attr: AttrValue) -> Result<u64>

Source§

impl DataType for [u8]

Source§

type Type = [u8]

Source§

unsafe fn set(attr: &mut AttrValue, val: &[u8]) -> Result<()>

Source§

unsafe fn get(attr: AttrValue) -> Result<Vec<u8>>

Implementors§