AddOutputParams

Struct AddOutputParams 

Source
pub struct AddOutputParams {
Show 18 fields pub date: Date, pub generated: Option<u32>, pub exported: Option<u32>, pub peak: Option<u32>, pub peak_time: Option<Time>, pub conditions: Option<Conditions>, pub min_temp: Option<f32>, pub max_temp: Option<f32>, pub comment: Option<String>, pub import_peak: Option<u32>, pub import_off_peak: Option<u32>, pub import_shoulder: Option<u32>, pub import_high_shoulder: Option<u32>, pub consumption: Option<u32>, pub export_peak: Option<u32>, pub export_off_peak: Option<u32>, pub export_shoulder: Option<u32>, pub export_high_shoulder: Option<u32>,
}
Expand description

Parameters for the add_outputs endpoint.

§Example

AddOutputParams::new can be used to create a parameter struct with all other fields set to None. This can be used to easily create parameters with only one or two fields set:

use pvoutput_client::types::{Conditions, params::AddOutputParams};
use jiff::civil::Date;

let params = AddOutputParams {
  generated: Some(1_500),
  conditions: Some(Conditions::Cloudy),
  ..AddOutputParams::new(Date::constant(2025, 09, 22))
};

Fields§

§date: Date

Output date.

Must be after 2000-01-01 and not in the future.

§generated: Option<u32>

Power generated in watt-hours. This is required if an output does not yet exist for this date.

§exported: Option<u32>

Power exported in watt-hours.

§peak: Option<u32>

Peak power output in watts.

§peak_time: Option<Time>

The time at which the peak output was recorded. Seconds will be truncated – 11:15:05 becomes 11:15.

§conditions: Option<Conditions>

The day’s weather conditions.

§min_temp: Option<f32>

The minimum recorded temperature in degrees Celsius.

If set, a maximum temperature must also be provided, and the minimum temperature must be lower than the maximum temperature.

Both temperatures must be between -100.0 and 100.0.

§max_temp: Option<f32>

The maximum recorded temperature in degrees Celsius.

If set, a minimum temperature must also be provided, and the minimum temperature must be lower than the maximum temperature.

Both temperatures must be between -100.0 and 100.0.

§comment: Option<String>

A comment.

§import_peak: Option<u32>

The amount of energy imported during the peak tariff in watt-hours.

§import_off_peak: Option<u32>

The amount of energy imported during the off-peak tariff in watt-hours.

§import_shoulder: Option<u32>

The amount of energy imported during the shoulder tariff in watt-hours.

§import_high_shoulder: Option<u32>

The amount of energy imported during the high-shoulder tariff in watt-hours.

§consumption: Option<u32>

Energy consumption in watt-hours.

Limited to 999,999,999 Wh.

§export_peak: Option<u32>

The amount of energy exported during the peak tariff in watt-hours.

§export_off_peak: Option<u32>

The amount of energy exported during the off-peak tariff in watt-hours.

§export_shoulder: Option<u32>

The amount of energy exported during the shoulder tariff in watt-hours.

§export_high_shoulder: Option<u32>

The amount of energy exported during the high-shoulder tariff in watt-hours.

Implementations§

Source§

impl AddOutputParams

Source

pub const fn new(date: Date) -> Self

Creates a new AddOutputParams for the given date with all other fields set to None.

Trait Implementations§

Source§

impl Clone for AddOutputParams

Source§

fn clone(&self) -> AddOutputParams

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AddOutputParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for AddOutputParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more