Type Alias CapeArrayByteOut

Source
pub type CapeArrayByteOut<'a> = CapeArrayOut<'a, CapeByte, ICapeArrayByte>;
Expand description

CapeArrayByteOut wraps an ICapeArrayByte interface pointer.

Given an ICapeArrayByte interface pointer, this allows setting and getting the elements.

This interface is typically used as arguments to rust methods on traits that are generated from CAPE-OPEN interfaces that have ICapeArrayByte output arguments.

§Examples

use cobia::*;

fn set_content(a: &mut CapeArrayByteOut) {
	a.put_array(&[2u8,8u8,10u8]).unwrap();
}
 
let mut arr = cobia::CapeArrayByteVec::new();
set_content(&mut CapeArrayByteOutFromProvider::from(&mut arr).as_cape_array_byte_out());
assert_eq!(arr.as_vec(), &vec![2u8,8u8,10u8]);

Aliased Type§

pub struct CapeArrayByteOut<'a> {
    pub(crate) interface: &'a mut *mut ICapeArrayByte,
    data: *mut u8,
    size: u32,
}

Fields§

§interface: &'a mut *mut ICapeArrayByte§data: *mut u8§size: u32

Implementations§

Source§

impl<'a> CapeArrayByteOut<'a>

Source

pub fn set<T: CapeArrayByteProviderIn>( &mut self, array: &T, ) -> Result<(), COBIAError>

Set the content of the byte array from any object that implements CapeArrayByteProviderIn.

§Arguments
  • array - An object that implements CapeArrayByteProviderIn
§Examples
use cobia::*;
let mut arr = cobia::CapeArrayByteVec::new();
let mut arr1 = cobia::CapeArrayByteVec::from_slice(&vec![2u8,8u8,10u8]);
CapeArrayByteOutFromProvider::from(&mut arr).as_cape_array_byte_out().set(&arr1);
assert_eq!(arr.as_vec(), &[2u8,8u8,10u8]);

Trait Implementations§