#[non_exhaustive]pub struct NoteWidgetDefinition {
pub background_color: Option<String>,
pub content: String,
pub font_size: Option<String>,
pub has_padding: Option<bool>,
pub show_tick: Option<bool>,
pub text_align: Option<WidgetTextAlign>,
pub tick_edge: Option<WidgetTickEdge>,
pub tick_pos: Option<String>,
pub type_: NoteWidgetDefinitionType,
pub vertical_align: Option<WidgetVerticalAlign>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The notes and links widget is similar to free text widget, but allows for more formatting options.
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.background_color: Option<String>
Background color of the note.
content: String
Content of the note.
font_size: Option<String>
Size of the text.
has_padding: Option<bool>
Whether to add padding or not.
show_tick: Option<bool>
Whether to show a tick or not.
text_align: Option<WidgetTextAlign>
How to align the text on the widget.
tick_edge: Option<WidgetTickEdge>
Define how you want to align the text on the widget.
tick_pos: Option<String>
Where to position the tick on an edge.
type_: NoteWidgetDefinitionType
Type of the note widget.
vertical_align: Option<WidgetVerticalAlign>
Vertical alignment.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl NoteWidgetDefinition
impl NoteWidgetDefinition
Sourcepub fn new(
content: String,
type_: NoteWidgetDefinitionType,
) -> NoteWidgetDefinition
pub fn new( content: String, type_: NoteWidgetDefinitionType, ) -> NoteWidgetDefinition
Examples found in repository?
examples/v1_dashboards_CreateDashboard_417992286.rs (line 18)
13async fn main() {
14 let body = Dashboard::new(
15 DashboardLayoutType::FREE,
16 "Example-Dashboard".to_string(),
17 vec![Widget::new(WidgetDefinition::NoteWidgetDefinition(Box::new(
18 NoteWidgetDefinition::new("# Example Note".to_string(), NoteWidgetDefinitionType::NOTE),
19 )))
20 .layout(WidgetLayout::new(24, 18, 0, 0))],
21 )
22 .description(Some("".to_string()))
23 .notify_list(Some(vec![]))
24 .template_variables(Some(vec![]));
25 let configuration = datadog::Configuration::new();
26 let api = DashboardsAPI::with_config(configuration);
27 let resp = api.create_dashboard(body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
pub fn background_color(self, value: String) -> Self
pub fn font_size(self, value: String) -> Self
pub fn has_padding(self, value: bool) -> Self
pub fn show_tick(self, value: bool) -> Self
pub fn text_align(self, value: WidgetTextAlign) -> Self
pub fn tick_edge(self, value: WidgetTickEdge) -> Self
pub fn tick_pos(self, value: String) -> Self
pub fn vertical_align(self, value: WidgetVerticalAlign) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for NoteWidgetDefinition
impl Clone for NoteWidgetDefinition
Source§fn clone(&self) -> NoteWidgetDefinition
fn clone(&self) -> NoteWidgetDefinition
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 NoteWidgetDefinition
impl Debug for NoteWidgetDefinition
Source§impl<'de> Deserialize<'de> for NoteWidgetDefinition
impl<'de> Deserialize<'de> for NoteWidgetDefinition
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 NoteWidgetDefinition
impl PartialEq for NoteWidgetDefinition
Source§impl Serialize for NoteWidgetDefinition
impl Serialize for NoteWidgetDefinition
impl StructuralPartialEq for NoteWidgetDefinition
Auto Trait Implementations§
impl Freeze for NoteWidgetDefinition
impl RefUnwindSafe for NoteWidgetDefinition
impl Send for NoteWidgetDefinition
impl Sync for NoteWidgetDefinition
impl Unpin for NoteWidgetDefinition
impl UnwindSafe for NoteWidgetDefinition
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