Some fixup for the documentation

This commit is contained in:
Olivier Goffart 2020-08-25 14:08:27 +02:00
parent 304b0e7b0e
commit 2c0fc29c5c
3 changed files with 6 additions and 5 deletions

View file

@ -8,7 +8,7 @@ use core::pin::Pin;
#[doc(inline)] #[doc(inline)]
pub use const_field_offset_macro::FieldOffsets; pub use const_field_offset_macro::FieldOffsets;
pub use field_offset::*; pub use field_offset::{AllowPin, FieldOffset, NotPinned};
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
@ -155,6 +155,7 @@ union TransmutePinFlag<Container, Field, PinFlag> {
y: FieldOffset<Container, Field>, y: FieldOffset<Container, Field>,
} }
/// Helper class used as the result of the addition of two stype that implement the `ConstFieldOffset` trait
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct ConstFieldOffsetSum<A: ConstFieldOffset, B: ConstFieldOffset>(pub A, pub B); pub struct ConstFieldOffsetSum<A: ConstFieldOffset, B: ConstFieldOffset>(pub A, pub B);

View file

@ -17,9 +17,9 @@ use triomphe::{Arc, HeaderWithLength, ThinArc};
#[derive(Clone)] #[derive(Clone)]
#[repr(C)] #[repr(C)]
/// SharedArray holds a reference-counted read-only copy of [T]. /// SharedArray holds a reference-counted read-only copy of `[T]`.
pub struct SharedArray<T: 'static> { pub struct SharedArray<T: 'static> {
/// Invariant: The usize header is the `len` of the vector, the contained buffer is [T] /// Invariant: The usize header is the `len` of the vector, the contained buffer is `[T]`
inner: ThinArc<usize, MaybeUninit<T>>, inner: ThinArc<usize, MaybeUninit<T>>,
} }

View file

@ -25,8 +25,8 @@ use triomphe::{Arc, HeaderWithLength, ThinArc};
#[derive(Clone)] #[derive(Clone)]
#[repr(C)] #[repr(C)]
pub struct SharedString { pub struct SharedString {
/// Invariant: The usize header is the `len` of the vector, the contained buffer is [MaybeUninit<u8>] /// Invariant: The usize header is the `len` of the vector, the contained buffer is `[MaybeUninit<u8>]`
/// buffer[0..=len] is initialized and valid utf8, and buffer[len] is '\0' /// `buffer[0..=len]` is initialized and valid utf8, and `buffer[len]` is '\0'
inner: ThinArc<usize, MaybeUninit<u8>>, inner: ThinArc<usize, MaybeUninit<u8>>,
} }