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

source

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.

source

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.

source

pub fn get_attr<T>(&self, name: impl AsRef<str>) -> T
where T: FromStr, T::Err: Error + Send + Sync + 'static,

source

pub fn try_get_attr<T>(&self, name: impl AsRef<str>) -> Option<T>
where T: FromStr, T::Err: Error + Send + Sync + 'static,

source

pub fn is_attr_set(&self, name: impl AsRef<str>) -> bool

source

pub fn archetype_view_types(&self) -> Option<Vec<ViewReference>>

source

pub fn is_struct(&self) -> bool

source

pub fn is_enum(&self) -> bool

source

pub fn is_union(&self) -> bool

source

pub fn is_arrow_transparent(&self) -> bool

source

fn is_transparent(&self) -> bool

source

pub fn has_default_destructor(&self, objects: &Objects) -> bool

Is the destructor trivial/default (i.e. is this simple data with no allocations)?

source

pub fn relative_filepath(&self) -> Option<&Utf8Path>

Try to find the relative file path of the .fbs source file.

source

pub fn snake_case_name(&self) -> String

The snake_case name of the object, e.g. translation_and_mat3x3.

source

pub fn is_testing(&self) -> bool

Returns true if this object is part of testing and not to be used in the production SDK.

source

pub fn scope(&self) -> Option<String>

source

pub fn deprecation_notice(&self) -> Option<String>

source

pub fn is_experimental(&self) -> bool

source

pub fn doc_category(&self) -> Option<String>

source

pub fn crate_name(&self) -> String

Returns the crate name of an object, accounting for overrides.

source

pub fn module_name(&self) -> String

Returns the module name of an object.

source

pub fn is_archetype(&self) -> bool

Trait Implementations§

source§

impl Clone for Object

source§

fn clone(&self) -> Object

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CppObjectExtensions for Object

source§

impl Debug for Object

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Ord for Object

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Object

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Object

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PythonObjectExt for Object

source§

fn is_delegating_component(&self) -> bool

Returns true if the object is a delegating component. Read more
source§

fn is_non_delegating_component(&self) -> bool

Returns true if the object is a non-delegating component.
source§

fn delegate_datatype<'a>(&self, objects: &'a Objects) -> Option<&'a Object>

If the object is a delegating component, returns the datatype it delegates to.
source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for T
where T: Clone,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T

§

impl<T> Ungil for T
where T: Send,