fn is_mut_safe(&self) -> bool {
        let kind = self.kind();

        // Always check `inline` first, because if the handle is using inline
        // data storage, all of the `Inner` struct fields will be gibberish.
        if kind == KIND_INLINE {
            // Inlined buffers can always be mutated as the data is never shared
            // across handles.
            true
        } else if kind == KIND_STATIC {
            false
        } else if kind == KIND_VEC {
            // Otherwise, the underlying buffer is potentially shared with other
            // handles, so the ref_count needs to be checked.
            unsafe { (*self.shared_vec()).is_unique() }
        } else {
            // Otherwise, the underlying buffer is potentially shared with other
            // handles, so the ref_count needs to be checked.
            unsafe { (*self.arc.as_ptr()).is_unique() }
        }
    }
/// Checks if it is safe to mutate the memory
Checks if it is safe to mutate the memory
Checks if it is safe to mutate the memory
fn is_mut_safe(&self) -> bool {
        let kind = self.kind();
        // Always check `inline` first, because if the handle is using inline
        // data storage, all of the `Inner` struct fields will be gibberish.
        if kind == KIND_INLINE {
            // Inlined buffers can always be mutated as the data is never shared
            // across handles.
            true
        } else if kind == KIND_STATIC {
            false
        } else if kind == KIND_VEC {
            // Otherwise, the underlying buffer is potentially shared with other
            // handles, so the ref_count needs to be checked.
            unsafe { (*self.shared_vec()).is_unique() }
        } else {
            // Otherwise, the underlying buffer is potentially shared with other
            // handles, so the ref_count needs to be checked.
            unsafe { (*self.arc.as_ptr()).is_unique() }
        }
    }
fn is_mut_safe ( & self ) -> bool { let kind = self . kind ( ) ; // Always check `inline` first, because if the handle is using inline // data storage, all of the `Inner` struct fields will be gibberish. if kind == KIND_INLINE { // Inlined buffers can always be mutated as the data is never shared // across handles. true } else if kind == KIND_STATIC { false } else if kind == KIND_VEC { // Otherwise, the underlying buffer is potentially shared with other // handles, so the ref_count needs to be checked. unsafe { ( * self . shared_vec ( ) ) . is_unique ( ) } } else { // Otherwise, the underlying buffer is potentially shared with other // handles, so the ref_count needs to be checked. unsafe { ( * self . arc . as_ptr ( ) ) . is_unique ( ) } } }
Checks if it is safe to mutate the memory
Checks if it is safe to mutate the memory
&self
&self