fn copy_to_buffer<'a, T: Sized + Copy>(object: &'a mut SchemaObject, data: &[T]) -> &'a mut [T] {
    let len = data.len();
    let byte_len = mem::size_of::<T>() * len;

    unsafe {
        // Allocate a buffer owned by `object` to hold the copied data.
        let result_ptr = Schema_AllocateBuffer(object.as_ptr_mut(), byte_len as _) as *mut _;

        // Copy the data from the source buffer into the new buffer.
        ptr::copy_nonoverlapping(data.as_ptr(), result_ptr, len);

        slice::from_raw_parts_mut(result_ptr, len)
    }
}
/// Copies the provided slice of data into a buffer owned by `object`.
///
/// Returns a pointer to the resulting buffer. The buffer is owned by `object` and will have the same lifetime as a result.
Copies the provided slice of data into a buffer owned by `object`.
Returns a pointer to the resulting buffer. The buffer is owned by `object` and will have the same lifetime as a result.
Copies the provided slice of data into a buffer owned by ` object ` . Returns a pointer to the resulting buffer . The buffer is owned by ` object ` and will have the same lifetime as a result .
fn copy_to_buffer<'a, T: Sized + Copy>(object: &'a mut SchemaObject, data: &[T]) -> &'a mut [T] {
    let len = data.len();
    let byte_len = mem::size_of::<T>() * len;
    unsafe {
        // Allocate a buffer owned by `object` to hold the copied data.
        let result_ptr = Schema_AllocateBuffer(object.as_ptr_mut(), byte_len as _) as *mut _;
        // Copy the data from the source buffer into the new buffer.
        ptr::copy_nonoverlapping(data.as_ptr(), result_ptr, len);
        slice::from_raw_parts_mut(result_ptr, len)
    }
}
fn copy_to_buffer < ' a , T : Sized + Copy > ( object : & ' a mut SchemaObject , data : & [ T ] ) -> & ' a mut [ T ] { let len = data . len ( ) ; let byte_len = mem :: size_of :: < T > ( ) * len ; unsafe { // Allocate a buffer owned by `object` to hold the copied data. let result_ptr = Schema_AllocateBuffer ( object . as_ptr_mut ( ) , byte_len as _ ) as * mut _ ; // Copy the data from the source buffer into the new buffer. ptr :: copy_nonoverlapping ( data . as_ptr ( ) , result_ptr , len ) ; slice :: from_raw_parts_mut ( result_ptr , len ) } }
Copies the provided slice of data into a buffer owned by `object`.
Copies the provided slice of data into a buffer owned by ` object ` .
object
&'a mut SchemaObject
data
&[T]
object
&'a mut SchemaObject
data
&[T]