Skip to main content

ObservedData

Struct ObservedData 

Source
pub struct ObservedData {
    pub type_: String,
    pub id: String,
    pub first_observed: String,
    pub last_observed: String,
    pub number_observed: u64,
    pub object_refs: Vec<String>,
    pub objects: Option<BTreeMap<String, StixValue>>,
    pub additional: BTreeMap<String, StixValue>,
}
Expand description

The STIX observed-data SDO.

Carries the temporal fields and object_refs the matcher needs. Unknown or custom properties are retained in additional (via #[serde(flatten)]) so the ObjectView still exposes them. Tolerates STIX 2.0 inline objects as well as 2.1 object_refs.

Fields§

§type_: String

The STIX type property (always observed-data).

§id: String

The object’s STIX id.

§first_observed: String

The start of the observation window (RFC3339 timestamp).

§last_observed: String

The end of the observation window (RFC3339 timestamp).

§number_observed: u64

How many times the window’s contents were observed.

§object_refs: Vec<String>

The ids of the referenced SCOs (STIX 2.1).

§objects: Option<BTreeMap<String, StixValue>>

STIX 2.0 inline observed objects (objects), if present.

§additional: BTreeMap<String, StixValue>

Any other properties, retained for ObjectView and round-tripping.

Implementations§

Source§

impl ObservedData

Source

pub fn sco_ids(&self) -> Vec<&str>

The referenced SCO ids. Prefers 2.1 object_refs; otherwise empty. (2.0 inline objects are keyed locally, not by id, so they yield no refs.)

Trait Implementations§

Source§

impl Clone for ObservedData

Source§

fn clone(&self) -> ObservedData

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ObservedData

Source§

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

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

impl<'de> Deserialize<'de> for ObservedData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl ObjectView for ObservedData

Source§

fn id(&self) -> Option<&str>

The object’s STIX id, if it has one.
Source§

fn type_(&self) -> Option<&str>

The object’s STIX type, if it has one.
Source§

fn property(&self, name: &str) -> Option<StixValue>

The named top-level property as an owned value, or None if absent.
Source§

impl PartialEq for ObservedData

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ObservedData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ObservedData

Auto Trait Implementations§

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> CustomObject for T
where T: ObjectView + Serialize + Debug + Send + Sync + 'static,

Source§

fn as_json(&self) -> Value

The object serialized as a JSON value.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

The object as &dyn Any, for downcasting to the concrete type.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToOwned for T
where T: Clone,

Source§

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

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.