pub struct PageContribution {
pub page_index: usize,
pub url: Option<String>,
pub contribution: String,
pub weight: f64,
pub key_points: Vec<String>,
}Expand description
Contribution of a single page to the synthesis.
Fields§
§page_index: usizeIndex of the page (0-based).
url: Option<String>URL of the page.
contribution: StringDescription of the contribution.
weight: f64Weight/importance of this page’s contribution (0.0-1.0).
key_points: Vec<String>Key data points from this page.
Implementations§
Source§impl PageContribution
impl PageContribution
Sourcepub fn new(
page_index: usize,
contribution: impl Into<String>,
weight: f64,
) -> PageContribution
pub fn new( page_index: usize, contribution: impl Into<String>, weight: f64, ) -> PageContribution
Create a new page contribution.
Sourcepub fn with_url(self, url: impl Into<String>) -> PageContribution
pub fn with_url(self, url: impl Into<String>) -> PageContribution
Set URL.
Sourcepub fn with_key_points(self, points: Vec<String>) -> PageContribution
pub fn with_key_points(self, points: Vec<String>) -> PageContribution
Add key points.
Sourcepub fn from_json(value: &Value) -> Option<PageContribution>
pub fn from_json(value: &Value) -> Option<PageContribution>
Parse from JSON.
Trait Implementations§
Source§impl Clone for PageContribution
impl Clone for PageContribution
Source§fn clone(&self) -> PageContribution
fn clone(&self) -> PageContribution
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 PageContribution
impl Debug for PageContribution
Source§impl<'de> Deserialize<'de> for PageContribution
impl<'de> Deserialize<'de> for PageContribution
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PageContribution, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PageContribution, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PageContribution
impl Serialize for PageContribution
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for PageContribution
impl RefUnwindSafe for PageContribution
impl Send for PageContribution
impl Sync for PageContribution
impl Unpin for PageContribution
impl UnwindSafe for PageContribution
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