Skip to main content

TrafficSign

Struct TrafficSign 

Source
pub struct TrafficSign<'a> {
    pub traffic_sign: &'a TrafficSign,
}
Expand description

Models a physical traffic sign — a static, passive signaling device placed along or above the road to convey regulatory, warning, or informational messages to road users.

Unlike TrafficLight, traffic signs do not expose phase-based bulb states. A sign may still be marked as dynamic or movable by backend metadata.

Fields§

§traffic_sign: &'a TrafficSign

Implementations§

Source§

impl<'a> TrafficSign<'a>

Source

pub fn id(&self) -> String

Gets the unique identifier of the TrafficSign.

§Returns

The id of the TrafficSign.

Source

pub fn sign_type(&self) -> TrafficSignType

Gets the TrafficSignType of the TrafficSign.

§Returns

The TrafficSignType.

Source

pub fn position_road_network(&self) -> InertialPosition

Gets the position of the TrafficSign in the road network’s Inertial frame.

§Returns

An super::InertialPosition representing the position of the TrafficSign.

Source

pub fn orientation_road_network(&self) -> Rotation

Gets the orientation of the TrafficSign in the road network’s Inertial frame.

§Returns

An super::Rotation representing the orientation of the TrafficSign.

Source

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

Gets the optional text message displayed on the TrafficSign.

§Returns

Some(String) if a message is set, None otherwise.

Source

pub fn is_dynamic(&self) -> bool

Returns whether this sign can change semantically over time.

Source

pub fn is_movable(&self) -> bool

Returns whether this sign’s position can change.

Source

pub fn related_lanes(&self) -> Vec<String>

Gets the lane IDs that this sign is physically relevant to.

§Returns

A vector of lane ID strings.

Source

pub fn bounding_box(&self) -> BoundingBox

Gets the bounding box of the TrafficSign.

§Returns

A crate::math::BoundingBox describing the sign’s oriented bounding volume. The box position is the centroid, box_size gives full extents, and orientation is expressed as roll-pitch-yaw angles.

Source

pub fn value(&self) -> Option<TrafficSignValue>

Gets the optional numeric value associated with the TrafficSign.

§Returns

Some(TrafficSignValue) if a value is set, None otherwise.

Source

pub fn properties(&self) -> HashMap<String, String>

Returns backend-specific key-value properties for this TrafficSign.

Source

pub fn dependent_signs(&self) -> Vec<String>

Returns the TrafficSigns’ IDs that depend on this sign, if any. For example, a “Stop” sign may have an associated “All way” sign.

Auto Trait Implementations§

§

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

§

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

§

impl<'a> Freeze for TrafficSign<'a>

§

impl<'a> RefUnwindSafe for TrafficSign<'a>

§

impl<'a> Unpin for TrafficSign<'a>

§

impl<'a> UnsafeUnpin for TrafficSign<'a>

§

impl<'a> UnwindSafe for TrafficSign<'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.