unsafe fn initialize_into(allocation: *mut u8, label_offsets: &[u8], slices: &[&[u8]]) {
        let n_labels = label_offsets.len();
        allocation.write(n_labels as u8);
        ptr::copy_nonoverlapping(
            label_offsets as *const [u8] as *const u8,
            allocation.add(1),
            n_labels,
        );
        let mut index = 1 + n_labels;
        for slice in slices {
            // The call to ptr::add is safe:
            //
            // * If label_offsets and slices provide a valid domain
            //   name, as our safety preconditions require, then index
            //   does not overflow an isize.
            // * The caller promised that allocation is, in fact, a
            //   single allocated object.
            //
            // The call to ptr::copy_nonoverlapping is safe, since the
            // caller promised that the allocation is valid for the
            // writes we make and that none of the slices overlaps the
            // allocation.
            ptr::copy_nonoverlapping(
                *slice as *const [u8] as *const u8,
                allocation.add(index),
                slice.len(),
            );
            index += slice.len();
        }
    }
/// Initializes a new `Name` structure at the given allocation.
///
/// This will fill in the `n_labels` field based on the number of
/// label offsets provided. The `label_offsets` slice gives the
/// index of the starting octet of each label in the domain name's
/// on-the-wire representation. The slices given in `slices`, when
/// concatenated, provide the on-the-wire representation of the
/// name being constructed.
///
/// # Safety
///
/// The caller must ensure that
///
/// * the provided memory region is in fact a single allocation;
/// * the allocation is valid for writes for the proper size (use
///   [`Name::size_required_for`] for this);
/// * the `slices` provide a valid domain name in the on-the-wire
///   representation, and `label_offsets` provides the offsets of
///   the labels correctly; and
/// * none of the slices overlaps the allocation, since
///   [`ptr::copy_nonoverlapping`] is used under the hood.
Initializes a new `Name` structure at the given allocation.
This will fill in the `n_labels` field based on the number of
label offsets provided. The `label_offsets` slice gives the
index of the starting octet of each label in the domain name's
on-the-wire representation. The slices given in `slices`, when
concatenated, provide the on-the-wire representation of the
name being constructed.
Initializes a new ` Name ` structure at the given allocation . This will fill in the ` n_labels ` field based on the number of label offsets provided . The ` label_offsets ` slice gives the index of the starting octet of each label in the domain name ' s on - the - wire representation . The slices given in ` slices ` when concatenated provide the on - the - wire representation of the name being constructed .
unsafe fn initialize_into(allocation: *mut u8, label_offsets: &[u8], slices: &[&[u8]]) {
        let n_labels = label_offsets.len();
        allocation.write(n_labels as u8);
        ptr::copy_nonoverlapping(
            label_offsets as *const [u8] as *const u8,
            allocation.add(1),
            n_labels,
        );
        let mut index = 1 + n_labels;
        for slice in slices {
            // The call to ptr::add is safe:
            //
            // * If label_offsets and slices provide a valid domain
            //   name, as our safety preconditions require, then index
            //   does not overflow an isize.
            // * The caller promised that allocation is, in fact, a
            //   single allocated object.
            //
            // The call to ptr::copy_nonoverlapping is safe, since the
            // caller promised that the allocation is valid for the
            // writes we make and that none of the slices overlaps the
            // allocation.
            ptr::copy_nonoverlapping(
                *slice as *const [u8] as *const u8,
                allocation.add(index),
                slice.len(),
            );
            index += slice.len();
        }
    }
unsafe fn initialize_into ( allocation : * mut u8 , label_offsets : & [ u8 ] , slices : & [ & [ u8 ] ] ) { let n_labels = label_offsets . len ( ) ; allocation . write ( n_labels as u8 ) ; ptr :: copy_nonoverlapping ( label_offsets as * const [ u8 ] as * const u8 , allocation . add ( 1 ) , n_labels , ) ; let mut index = 1 + n_labels ; for slice in slices { // The call to ptr::add is safe: // // * If label_offsets and slices provide a valid domain //   name, as our safety preconditions require, then index //   does not overflow an isize. // * The caller promised that allocation is, in fact, a //   single allocated object. // // The call to ptr::copy_nonoverlapping is safe, since the // caller promised that the allocation is valid for the // writes we make and that none of the slices overlaps the // allocation. ptr :: copy_nonoverlapping ( * slice as * const [ u8 ] as * const u8 , allocation . add ( index ) , slice . len ( ) , ) ; index += slice . len ( ) ; } }
Initializes a new `Name` structure at the given allocation.
Initializes a new ` Name ` structure at the given allocation .
allocation
*mut u8
label_offsets
&[u8]
slices
&[&[u8]]
allocation
*mut u8
label_offsets
&[u8]
slices
&[&[u8]]
safety
The caller must ensure that

the provided memory region is in fact a single allocation;
the allocation is valid for writes for the proper size (use
[`Name::size_required_for`] for this);
the `slices` provide a valid domain name in the on-the-wire
representation, and `label_offsets` provides the offsets of
the labels correctly; and
none of the slices overlaps the allocation, since
[`ptr::copy_nonoverlapping`] is used under the hood.
The caller must ensure that the provided memory region is in fact a single allocation ; the allocation is valid for writes for the proper size ( use [ ` Name :: size_required_for ` ] for this ) ; the ` slices ` provide a valid domain name in the on - the - wire representation and ` label_offsets ` provides the offsets of the labels correctly ; and none of the slices overlaps the allocation since [ ` ptr :: copy_nonoverlapping ` ] is used under the hood .