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: u32Implementations§
Source§impl<'a> CapeArrayByteOut<'a>
impl<'a> CapeArrayByteOut<'a>
Sourcepub fn set<T: CapeArrayByteProviderIn>(
&mut self,
array: &T,
) -> Result<(), COBIAError>
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§
Source§impl<'a> CapeArrayByteProviderOut for CapeArrayByteOut<'a>
impl<'a> CapeArrayByteProviderOut for CapeArrayByteOut<'a>
Source§fn as_cape_array_byte_out(&mut self) -> ICapeArrayByte
fn as_cape_array_byte_out(&mut self) -> ICapeArrayByte
Convert to ICapeArrayByte