pub struct Union<'a> {
pub _tab: Table<'a>,
}
Expand description
A union is a complex type with children in Field
By default ids in the type vector refer to the offsets in the children
optionally typeIds provides an indirection between the child offset and the type id
for each child typeIds[offset]
is the id used in the type vector
Fields§
§_tab: Table<'a>
Implementations§
source§impl<'a> Union<'a>
impl<'a> Union<'a>
pub const VT_MODE: u16 = 4u16
pub const VT_TYPEIDS: u16 = 6u16
pub unsafe fn init_from_table(table: Table<'a>) -> Union<'a>
pub fn create<'bldr, 'args, 'mut_bldr>(
_fbb: &'mut_bldr mut FlatBufferBuilder<'bldr>,
args: &'args UnionArgs<'args>,
) -> WIPOffset<Union<'bldr>>where
'bldr: 'args,
'args: 'mut_bldr,
pub fn mode(&self) -> UnionMode
pub fn typeIds(&self) -> Option<Vector<'a, i32>>
Trait Implementations§
source§impl Verifiable for Union<'_>
impl Verifiable for Union<'_>
source§fn run_verifier(
v: &mut Verifier<'_, '_>,
pos: usize,
) -> Result<(), InvalidFlatbuffer>
fn run_verifier( v: &mut Verifier<'_, '_>, pos: usize, ) -> Result<(), InvalidFlatbuffer>
Runs the verifier for this type, assuming its at position
pos
in the verifier’s buffer.
Should not need to be called directly.impl<'a> Copy for Union<'a>
impl<'a> StructuralPartialEq for Union<'a>
Auto Trait Implementations§
impl<'a> Freeze for Union<'a>
impl<'a> RefUnwindSafe for Union<'a>
impl<'a> Send for Union<'a>
impl<'a> Sync for Union<'a>
impl<'a> Unpin for Union<'a>
impl<'a> UnwindSafe for Union<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more