Struct grafana_plugin_sdk::data::Notice
source · #[non_exhaustive]pub struct Notice {
pub severity: Option<Severity>,
pub text: String,
pub link: Option<String>,
pub inspect: Option<InspectType>,
}
Expand description
A notification to be displayed in Grafana’s UI.
Example
use grafana_plugin_sdk::{data::{Frame, Metadata, Notice, Severity}, prelude::*};
let mut notice = Notice::new("Isn't this a cool set of data?".to_string());
notice.severity = Some(Severity::Info);
let mut metadata = Metadata::default();
metadata.notices = Some(vec![notice]);
let frame = Frame::new("frame")
.with_fields([
[1_u32, 2, 3].into_field("x"),
["a", "b", "c"].into_field("y"),
])
.with_metadata(metadata);
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.severity: Option<Severity>
The severity level of this notice.
text: String
Freeform descriptive text to display on the notice.
link: Option<String>
An optional link to display in the Grafana UI.
Can be an absolute URL or a path relative to Grafana’s root URL.
inspect: Option<InspectType>
An optional suggestion for which tab to display in the panel inspector in Grafana’s UI.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Notice
impl<'de> Deserialize<'de> for Notice
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 PartialEq for Notice
impl PartialEq for Notice
impl Eq for Notice
impl StructuralEq for Notice
impl StructuralPartialEq for Notice
Auto Trait Implementations§
impl RefUnwindSafe for Notice
impl Send for Notice
impl Sync for Notice
impl Unpin for Notice
impl UnwindSafe for Notice
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request