[][src]Function gvariant::aligned_bytes::copy_to_align

pub fn copy_to_align<'a, A: Alignment>(
    data: &'a [u8]
) -> Cow<'a, AlignedSlice<A>>

Aligns the given data to the alignment as given by the type parameter A.

This is convenient for when you can't ensure the alignment of your data in advance. By using Cow we only have to make a copy of the data if it is not aligned.