pub struct Alert {
pub id: AlertId,
pub cancel: AlertId,
pub min_version: Option<String>,
pub max_version: Option<String>,
pub priority: AlertPriority,
pub notice_until: Timestamp,
pub message: String,
pub signatures: Vec<JsonBytes>,
}
Expand description
An alert is a message about critical problems to be broadcast to all nodes via the p2p network.
§Examples
An example in JSON
{
"id": "0x1",
"cancel": "0x0",
"min_version": "0.1.0",
"max_version": "1.0.0",
"priority": "0x1",
"message": "An example alert message!",
"notice_until": "0x24bcca57c00",
"signatures": [
"0xbd07059aa9a3d057da294c2c4d96fa1e67eeb089837c87b523f124239e18e9fc7d11bb95b720478f7f937d073517d0e4eb9a91d12da5c88a05f750362f4c214dd0",
"0x0242ef40bb64fe3189284de91f981b17f4d740c5e24a3fc9b70059db6aa1d198a2e76da4f84ab37549880d116860976e0cf81cd039563c452412076ebffa2e4453"
]
}
Fields§
§id: AlertId
The identifier of the alert. Clients use id to filter duplicated alerts.
cancel: AlertId
Cancel a previous sent alert.
min_version: Option<String>
Optionally set the minimal version of the target clients.
See Semantic Version about how to specify a version.
max_version: Option<String>
Optionally set the maximal version of the target clients.
See Semantic Version about how to specify a version.
priority: AlertPriority
Alerts are sorted by priority, highest first.
notice_until: Timestamp
The alert is expired after this timestamp.
message: String
Alert message.
signatures: Vec<JsonBytes>
The list of required signatures.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Alert
impl<'de> Deserialize<'de> for Alert
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
Source§impl JsonSchema for Alert
impl JsonSchema for Alert
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreimpl Eq for Alert
impl StructuralPartialEq for Alert
Auto Trait Implementations§
impl Freeze for Alert
impl RefUnwindSafe for Alert
impl Send for Alert
impl Sync for Alert
impl Unpin for Alert
impl UnwindSafe for Alert
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)