Skip to main content

flash_lso/types/
object_id.rs

1/// A locally unique identifier for an Amf3 object
2///
3/// See the comment on `Value::Amf3ObjectReference` for details
4#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
6pub struct ObjectId(pub i64);
7
8impl ObjectId {
9    /// An invalid object id
10    ///
11    /// Use this when the id of an object can't be known or will never need to be referenced (e.g. amf0)
12    /// Unlike valid object id's, multiple objects with an `INVALID` id are explicitly allowed
13    /// Attempting to write a reference to an invalid object id is illegal and may error
14    /// Attempting to write an object with an invalid object id is allowed, but it cannot be referenced later
15    pub const INVALID: Self = ObjectId(-1);
16}