pub struct WritePointResponse {
pub request_id: String,
pub point_id: i32,
pub device_id: i32,
pub device_name: Arc<str>,
pub point_key: Arc<str>,
pub status: WritePointStatus,
pub error: Option<WritePointError>,
pub applied_value: Option<NGValue>,
pub completed_at: DateTime<Utc>,
}Expand description
Northward envelope protocol types (re-exported at crate root). Write-point response (Gateway -> northward plugin).
Fields§
§request_id: StringCorrelates to WritePoint.request_id.
point_id: i32Target point identifier.
device_id: i32Target device identifier (for routing/logging convenience).
device_name: Arc<str>Target device name (stable snapshot at response time).
§Notes
- This is provided for northward plugins so they can publish platform-facing payloads without performing extra runtime lookups.
- For hot paths,
Arc<str>is used to keep clones cheap.
point_key: Arc<str>Point key used for platform payload mapping (stable snapshot at response time).
§Notes
point_keyis the semantic identifier used by most northward protocols (e.g. MQTT JSON keys).- This is included to support best-practice “reported state” publishing without additional lookups.
status: WritePointStatusUnified status.
error: Option<WritePointError>Optional error details when failed.
applied_value: Option<NGValue>Applied value (optional). Gateway may echo the requested value on success.
completed_at: DateTime<Utc>Completion time generated by gateway.
Implementations§
Source§impl WritePointResponse
impl WritePointResponse
pub fn success( request_id: String, point_id: i32, device_id: i32, device_name: Arc<str>, point_key: Arc<str>, applied_value: Option<NGValue>, completed_at: DateTime<Utc>, ) -> Self
pub fn failed( request_id: String, point_id: i32, device_id: i32, device_name: Arc<str>, point_key: Arc<str>, error: WritePointError, completed_at: DateTime<Utc>, ) -> Self
Trait Implementations§
Source§impl Clone for WritePointResponse
impl Clone for WritePointResponse
Source§fn clone(&self) -> WritePointResponse
fn clone(&self) -> WritePointResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WritePointResponse
impl Debug for WritePointResponse
Source§impl<'de> Deserialize<'de> for WritePointResponse
impl<'de> Deserialize<'de> for WritePointResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl !Freeze for WritePointResponse
impl RefUnwindSafe for WritePointResponse
impl Send for WritePointResponse
impl Sync for WritePointResponse
impl Unpin for WritePointResponse
impl UnwindSafe for WritePointResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.