DemandRecord

Struct DemandRecord 

Source
pub struct DemandRecord<DateTime, BidderId: Eq + Hash, DemandId: Eq + Hash, PortfolioId: Eq + Hash, AppData> {
    pub id: DemandId,
    pub as_of: DateTime,
    pub bidder_id: BidderId,
    pub app_data: AppData,
    pub curve_data: Option<DemandCurve>,
    pub portfolio_group: Map<PortfolioId, f64>,
}
Expand description

Represents a demand entity in the flow trading system.

A demand captures a bidder’s interest in acquiring products through the system. Each demand is owned by a single bidder and can optionally include:

  • A demand curve that defines pricing preferences
  • A portfolio group that links this demand to one or more portfolios

Fields§

§id: DemandId

Unique identifier for this demand instance. Generated by the application when creating a new demand.

§as_of: DateTime

Timestamp when this version of the demand was created or last updated. Used for temporal queries and history tracking.

§bidder_id: BidderId

The bidder who owns this demand.

§app_data: AppData

Application-specific data attached to this demand. This field allows extending the demand with custom data without modifying the core schema.

§curve_data: Option<DemandCurve>

Optional demand curve defining the bidder’s pricing preferences.

When present, this curve is used by the solver to determine optimal allocations. Setting this to None effectively deletes the demand from active consideration while preserving its history.

§portfolio_group: Map<PortfolioId, f64>

Map of portfolios associated with this demand and their weights.

The map keys are portfolio IDs and values are weights that determine how this demand is distributed across portfolios. An empty map means the demand is not yet associated with any portfolios.

Auto Trait Implementations§

§

impl<DateTime, BidderId, DemandId, PortfolioId, AppData> Freeze for DemandRecord<DateTime, BidderId, DemandId, PortfolioId, AppData>
where DemandId: Freeze, DateTime: Freeze, BidderId: Freeze, AppData: Freeze,

§

impl<DateTime, BidderId, DemandId, PortfolioId, AppData> RefUnwindSafe for DemandRecord<DateTime, BidderId, DemandId, PortfolioId, AppData>
where DemandId: RefUnwindSafe, DateTime: RefUnwindSafe, BidderId: RefUnwindSafe, AppData: RefUnwindSafe, PortfolioId: RefUnwindSafe,

§

impl<DateTime, BidderId, DemandId, PortfolioId, AppData> Send for DemandRecord<DateTime, BidderId, DemandId, PortfolioId, AppData>
where DemandId: Send, DateTime: Send, BidderId: Send, AppData: Send, PortfolioId: Send,

§

impl<DateTime, BidderId, DemandId, PortfolioId, AppData> Sync for DemandRecord<DateTime, BidderId, DemandId, PortfolioId, AppData>
where DemandId: Sync, DateTime: Sync, BidderId: Sync, AppData: Sync, PortfolioId: Sync,

§

impl<DateTime, BidderId, DemandId, PortfolioId, AppData> Unpin for DemandRecord<DateTime, BidderId, DemandId, PortfolioId, AppData>
where DemandId: Unpin, DateTime: Unpin, BidderId: Unpin, AppData: Unpin, PortfolioId: Unpin,

§

impl<DateTime, BidderId, DemandId, PortfolioId, AppData> UnwindSafe for DemandRecord<DateTime, BidderId, DemandId, PortfolioId, AppData>
where DemandId: UnwindSafe, DateTime: UnwindSafe, BidderId: UnwindSafe, AppData: UnwindSafe, PortfolioId: UnwindSafe,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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.