pub enum AntFormat {
X(XFormat),
LinkedIn(LinkedInFormat),
}Expand description
A feed format: a categorical question over a platform’s actions, each action weighted.
Variants§
X(XFormat)
LinkedIn(LinkedInFormat)
Implementations§
Source§impl AntFormat
impl AntFormat
pub fn weights(&self) -> &'static [(&'static str, f64)]
pub fn max_weight(&self) -> f64
Sourcepub fn score(&self, counts: &HashMap<String, f64>) -> f64
pub fn score(&self, counts: &HashMap<String, f64>) -> f64
Phoenix style: Σ w_a * (count_a / n). Signed. Empty bucket is NaN.
pub fn from_json(json: &Value) -> Result<AntFormatOrFormat>
pub fn for_kind(kind: Stimuli) -> Vec<AntFormat>
Auto Trait Implementations§
impl !RefUnwindSafe for AntFormat
impl !UnwindSafe for AntFormat
impl Forget for AntFormat
impl Freeze for AntFormatwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Schema>: Freeze,
*const LeafNode<String, Schema> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Schema)>>: Freeze,
PhantomData<String>: Freeze,
*const Schema is !null: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
*const ArcInner<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send>>: Freeze,
impl Move for AntFormat
impl Send for AntFormatwhere
RawVecInner: Send,
NodeRef<Owned, String, Schema, LeafOrInternal>: Send,
BoxRaw<(String, Schema)>: Send,
BoxRaw<Schema>: Send,
RawTable<usize>: Send,
Arc<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send>: Send,
impl Sync for AntFormatwhere
RawVecInner: Sync,
NodeRef<Owned, String, Schema, LeafOrInternal>: Sync,
BoxRaw<(String, Schema)>: Sync,
BoxRaw<Schema>: Sync,
RawTable<usize>: Sync,
Arc<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send>: Sync,
impl Unpin for AntFormat
impl UnsafeUnpin for AntFormatwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Schema>: UnsafeUnpin,
*const LeafNode<String, Schema> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Schema)>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const Schema is !null: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
*const ArcInner<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Value, Arc<dyn Fn(Value) + Sync + Send>) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, Error>> + Send>> + Sync + Send>>: UnsafeUnpin,
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