maliput::api::rules

Struct Bulb

Source
pub struct Bulb<'a> {
    pub bulb: &'a Bulb,
}
Expand description

Models a bulb within a bulb group.

Fields§

§bulb: &'a Bulb

Implementations§

Source§

impl Bulb<'_>

Source

pub fn unique_id(&self) -> UniqueBulbId

Returns this Bulb instance’s unique identifier.

Source

pub fn id(&self) -> String

Get the id of the Bulb.

§Return

The id of the Bulb.

Source

pub fn color(&self) -> BulbColor

Get the color of the Bulb.

§Return

The BulbColor.

Source

pub fn bulb_type(&self) -> BulbType

Get the type of the Bulb.

§Return

The BulbType.

Source

pub fn position_bulb_group(&self) -> InertialPosition

Get the position of the Bulb in the bulb group.

§Return

An crate::api::InertialPosition representing the position of the Bulb in the bulb group.

Source

pub fn orientation_bulb_group(&self) -> Rotation

Get the orientation of the Bulb in the bulb group.

§Return

An crate::api::Rotation representing the orientation of the Bulb in the bulb group.

Source

pub fn arrow_orientation_rad(&self) -> Option<f64>

Returns the arrow’s orientation. Only applicable if Bulb::bulb_type returns BulbType::Arrow.

Source

pub fn states(&self) -> Vec<BulbState>

Get the possible states of the Bulb.

Source

pub fn get_default_state(&self) -> BulbState

Get the default state of the Bulb.

Source

pub fn is_valid_state(&self, state: &BulbState) -> bool

Check if the given state is possible valid for the Bulb.

Source

pub fn bounding_box(&self) -> (Vector3, Vector3)

Returns the bounding box of the bulb.

§Return

A tuple containing the minimum and maximum points of the bounding box.

Source

pub fn bulb_group(&self) -> BulbGroup<'_>

Returns the parent BulbGroup of the bulb.

§Return

The parent BulbGroup of the bulb. If the bulb is not part of any group, return None.

Auto Trait Implementations§

§

impl<'a> Freeze for Bulb<'a>

§

impl<'a> RefUnwindSafe for Bulb<'a>

§

impl<'a> !Send for Bulb<'a>

§

impl<'a> !Sync for Bulb<'a>

§

impl<'a> Unpin for Bulb<'a>

§

impl<'a> UnwindSafe for Bulb<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.