pub struct DataSource {
pub url: String,
pub refresh_minutes: Option<u32>,
pub method: Option<String>,
pub headers: BTreeMap<String, String>,
pub body: Option<String>,
}Expand description
Remote JSON the widget fetches without the app (WidgetConfig::source).
url, header values and body may use {{instance}} and {{locale}}, so each
placement of a widget can ask for its own data.
Fields§
§url: Stringhttps:// URL returning a JSON object (at most 256 KiB).
refresh_minutes: Option<u32>Minutes between fetches. Default 30; the OS may stretch it (minimum 15).
method: Option<String>GET (default) or POST.
headers: BTreeMap<String, String>Extra request headers.
body: Option<String>Request body for POST.
Trait Implementations§
Source§impl Clone for DataSource
impl Clone for DataSource
Source§impl Debug for DataSource
impl Debug for DataSource
Source§impl Default for DataSource
impl Default for DataSource
Source§impl<'de> Deserialize<'de> for DataSource
impl<'de> Deserialize<'de> for DataSource
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 DataSource
Available on crate feature schema only.
impl JsonSchema for DataSource
Available on crate feature
schema only.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(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &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 moreSource§impl PartialEq for DataSource
impl PartialEq for DataSource
Source§impl Serialize for DataSource
impl Serialize for DataSource
impl StructuralPartialEq for DataSource
Auto Trait Implementations§
impl Forget for DataSource
impl Freeze for DataSource
impl Move for DataSource
impl RefUnwindSafe for DataSource
impl Send for DataSource
impl Sync for DataSource
impl Unpin for DataSource
impl UnsafeUnpin for DataSource
impl UnwindSafe for DataSource
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