Struct re_types_builder::Object
source · pub struct Object {
pub virtpath: String,
pub filepath: Utf8PathBuf,
pub fqname: String,
pub pkg_name: String,
pub name: String,
pub docs: Docs,
pub kind: ObjectKind,
pub attrs: Attributes,
pub fields: Vec<ObjectField>,
pub class: ObjectClass,
pub datatype: Option<LazyDatatype>,
}
Expand description
A high-level representation of a flatbuffers object, which can be either a struct, a union or an enum.
Fields§
§virtpath: String
Utf8Path
of the associated fbs definition in the Flatbuffers hierarchy, e.g. //rerun/components/point2d.fbs
.
filepath: Utf8PathBuf
Absolute filepath of the associated fbs definition.
fqname: String
Fully-qualified name of the object, e.g. rerun.components.Position2D
.
pkg_name: String
Fully-qualified package name of the object, e.g. rerun.components
.
name: String
PascalCase
name of the object type, e.g. Position2D
.
docs: Docs
The object’s multiple layers of documentation.
kind: ObjectKind
The object’s kind: datatype, component or archetype.
attrs: Attributes
The object’s attributes.
fields: Vec<ObjectField>
The object’s inner fields, which can be either struct members or union/emum variants.
These are ordered using their order
attribute (structs),
or in the same order that they appeared in the .fbs (enum/union).
class: ObjectClass
struct, enum, or union?
datatype: Option<LazyDatatype>
The Arrow datatype of this Object
, or None
if the object is Arrow-transparent.
This is lazily computed when the parent object gets registered into the Arrow registry and
will be None
until then.
Implementations§
source§impl Object
impl Object
sourcepub fn from_raw_object(
reporter: &Reporter,
include_dir_path: impl AsRef<Utf8Path>,
enums: &[FbsEnum<'_>],
objs: &[FbsObject<'_>],
obj: &FbsObject<'_>,
) -> Self
pub fn from_raw_object( reporter: &Reporter, include_dir_path: impl AsRef<Utf8Path>, enums: &[FbsEnum<'_>], objs: &[FbsObject<'_>], obj: &FbsObject<'_>, ) -> Self
Resolves a raw crate::Object
into a higher-level representation that can be easily
interpreted and manipulated.
sourcepub fn from_raw_enum(
reporter: &Reporter,
include_dir_path: impl AsRef<Utf8Path>,
enums: &[FbsEnum<'_>],
objs: &[FbsObject<'_>],
enm: &FbsEnum<'_>,
) -> Self
pub fn from_raw_enum( reporter: &Reporter, include_dir_path: impl AsRef<Utf8Path>, enums: &[FbsEnum<'_>], objs: &[FbsObject<'_>], enm: &FbsEnum<'_>, ) -> Self
Resolves a raw FbsEnum
into a higher-level representation that can be easily
interpreted and manipulated.
pub fn get_attr<T>(&self, name: impl AsRef<str>) -> T
pub fn try_get_attr<T>(&self, name: impl AsRef<str>) -> Option<T>
pub fn is_attr_set(&self, name: impl AsRef<str>) -> bool
pub fn archetype_view_types(&self) -> Option<Vec<ViewReference>>
pub fn is_struct(&self) -> bool
pub fn is_enum(&self) -> bool
pub fn is_union(&self) -> bool
pub fn is_arrow_transparent(&self) -> bool
fn is_transparent(&self) -> bool
sourcepub fn has_default_destructor(&self, objects: &Objects) -> bool
pub fn has_default_destructor(&self, objects: &Objects) -> bool
Is the destructor trivial/default (i.e. is this simple data with no allocations)?
sourcepub fn relative_filepath(&self) -> Option<&Utf8Path>
pub fn relative_filepath(&self) -> Option<&Utf8Path>
Try to find the relative file path of the .fbs
source file.
sourcepub fn snake_case_name(&self) -> String
pub fn snake_case_name(&self) -> String
The snake_case
name of the object, e.g. translation_and_mat3x3
.
sourcepub fn is_testing(&self) -> bool
pub fn is_testing(&self) -> bool
Returns true if this object is part of testing and not to be used in the production SDK.
pub fn scope(&self) -> Option<String>
pub fn deprecation_notice(&self) -> Option<String>
pub fn is_experimental(&self) -> bool
pub fn doc_category(&self) -> Option<String>
sourcepub fn crate_name(&self) -> String
pub fn crate_name(&self) -> String
Returns the crate name of an object, accounting for overrides.
sourcepub fn module_name(&self) -> String
pub fn module_name(&self) -> String
Returns the module name of an object.
pub fn is_archetype(&self) -> bool
Trait Implementations§
source§impl CppObjectExtensions for Object
impl CppObjectExtensions for Object
source§impl Ord for Object
impl Ord for Object
source§impl PartialEq for Object
impl PartialEq for Object
source§impl PartialOrd for Object
impl PartialOrd for Object
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl PythonObjectExt for Object
impl PythonObjectExt for Object
source§fn is_delegating_component(&self) -> bool
fn is_delegating_component(&self) -> bool
true
if the object is a delegating component. Read moresource§fn is_non_delegating_component(&self) -> bool
fn is_non_delegating_component(&self) -> bool
true
if the object is a non-delegating component.impl Eq for Object
Auto Trait Implementations§
impl Freeze for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
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
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)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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