[][src]Trait df_st_core::fillable::Filler

pub trait Filler<D, S> where
    D: Fillable + Debug,
    S: Debug
{ pub fn add_missing_data(&mut self, source: &S); pub fn add_missing_data_indexed(&mut self, source: &S, _index: u64) { ... }
pub fn never_replace_data(&mut self, source: &S)
    where
        Self: Debug
, { ... }
pub fn replace_data(&mut self, source: &S)
    where
        Self: Debug
, { ... }
pub fn check_mergeable(&self, source: &S) -> bool
    where
        Self: Debug + Default + PartialEq<Self>,
        S: PartialEq<Self> + Debug
, { ... } }

Trait for object that are used for filling Fillable structs

Required methods

pub fn add_missing_data(&mut self, source: &S)[src]

Add data to self that is set as None or appends list items. Use source object to get values from.

Loading content...

Provided methods

pub fn add_missing_data_indexed(&mut self, source: &S, _index: u64)[src]

Add data to self from source. Same ways as add_missing_data. This function is used when adding data when looping over lists. This allows the index to be used. For example as an incremental ID. This function can be overwritten if this ID is wanted.

pub fn never_replace_data(&mut self, source: &S) where
    Self: Debug
[src]

Add data to self that is set as None or appends list items. If a value is Some it will leave the value as is.

pub fn replace_data(&mut self, source: &S) where
    Self: Debug
[src]

Add data to self. If already some value present, replace it. Appends list items. This is used when there is data that is richer then previous data. It does not trow the not_same_data warning. add_missing_data should be used in most cases instead.

pub fn check_mergeable(&self, source: &S) -> bool where
    Self: Debug + Default + PartialEq<Self>,
    S: PartialEq<Self> + Debug
[src]

Loading content...

Implementations on Foreign Types

impl Filler<i32, i32> for i32[src]

impl Filler<i32, Option<i32>> for i32[src]

impl Filler<u32, u32> for u32[src]

impl Filler<u8, u8> for u8[src]

impl Filler<bool, bool> for bool[src]

impl Filler<Option<bool>, Option<()>> for Option<bool>[src]

If a value is added the option is always Some. The absence of the add_missing_data defines None.

impl Filler<Option<bool>, Option<String>> for Option<bool>[src]

If a value is "true" or "false" use there respective boolean value. It the tag was a self closing tag <example/> then it will still be correct. This is so both (self closing and non-self closing) ways will work. So it works if the type was Option<bool> or Option<()> but both have to work.

impl Filler<String, String> for String[src]

impl<T, R> Filler<Vec<T, Global>, Vec<R, Global>> for Vec<T> where
    T: Fillable + Filler<T, R> + Default + Debug,
    R: PartialEq<T> + Debug
[src]

pub fn add_missing_data(&mut self, source: &Vec<R>)[src]

For each item in source list

  • If already in list, add_missing_data on both elements
  • Else push item to self list

impl<T, R> Filler<IndexMap<u64, T, RandomState>, IndexMap<u64, R, RandomState>> for IndexMap<u64, T> where
    T: Fillable + Filler<T, R> + Default + Debug + Hash,
    R: PartialEq<T> + Debug + Hash
[src]

pub fn add_missing_data(&mut self, source: &IndexMap<u64, R>)[src]

For each item in source list

  • If already in list, add_missing_data on both elements
  • Else push item to self list

impl<T, R> Filler<HashSet<T, RandomState>, HashSet<R, RandomState>> for HashSet<T> where
    T: Fillable + Filler<T, R> + Default + Debug + Eq + Hash,
    R: PartialEq<T> + Debug
[src]

pub fn add_missing_data(&mut self, source: &HashSet<R>)[src]

For each item in source list

  • If already in list, add_missing_data on both elements
  • Else push item to self list

impl<T, R> Filler<IndexMap<u64, T, RandomState>, Vec<R, Global>> for IndexMap<u64, T> where
    T: Fillable + Filler<T, R> + Default + Debug + Hash,
    R: PartialEq<T> + Debug + Hash
[src]

pub fn add_missing_data(&mut self, source: &Vec<R>)[src]

For each item in source list

  • If already in list, add_missing_data on both elements
  • Else push item to self list

impl<T, R> Filler<IndexMap<u64, T, RandomState>, HashSet<R, RandomState>> for IndexMap<u64, T> where
    T: Fillable + Filler<T, R> + Default + Debug + Hash,
    R: PartialEq<T> + Debug + Hash
[src]

pub fn add_missing_data(&mut self, source: &HashSet<R>)[src]

For each item in source list

  • If already in list, add_missing_data on both elements
  • Else push item to self list

impl<T, R> Filler<Option<T>, Option<R>> for Option<T> where
    T: Fillable + Filler<T, R> + Default + Debug,
    R: PartialEq<T> + Debug + Clone
[src]

impl<T, R> Filler<Vec<T, Global>, Option<Vec<R, Global>>> for Vec<T> where
    T: Fillable + Filler<T, R> + Default + Debug,
    R: PartialEq<T> + Debug
[src]

impl<T, R> Filler<IndexMap<u64, T, RandomState>, Option<Vec<R, Global>>> for IndexMap<u64, T> where
    T: Fillable + Filler<T, R> + Default + Debug + Hash,
    R: PartialEq<T> + Debug + Hash
[src]

Loading content...

Implementors

impl Filler<Artifact, Artifact> for Artifact[src]

impl Filler<Creature, Creature> for Creature[src]

impl Filler<CreatureBiome, CreatureBiome> for CreatureBiome[src]

impl Filler<DanceForm, DanceForm> for DanceForm[src]

impl Filler<Entity, Entity> for Entity[src]

impl Filler<EntityHonor, EntityHonor> for EntityHonor[src]

impl Filler<EntityLink, EntityLink> for EntityLink[src]

impl Filler<EntityOccasion, EntityOccasion> for EntityOccasion[src]

impl Filler<EntityOccasionSchedule, EntityOccasionSchedule> for EntityOccasionSchedule[src]

impl Filler<EntityOccasionScheduleFeature, EntityOccasionScheduleFeature> for EntityOccasionScheduleFeature[src]

impl Filler<EntityPosition, EntityPosition> for EntityPosition[src]

impl Filler<EntityPositionAssignment, EntityPositionAssignment> for EntityPositionAssignment[src]

impl Filler<EntityPopulation, EntityPopulation> for EntityPopulation[src]

impl Filler<HistoricalEra, HistoricalEra> for HistoricalEra[src]

impl Filler<HECircumstance, HECircumstance> for HECircumstance[src]

impl Filler<HEReason, HEReason> for HEReason[src]

impl Filler<HistoricalEvent, HistoricalEvent> for HistoricalEvent[src]

impl Filler<HistoricalEventCollection, HistoricalEventCollection> for HistoricalEventCollection[src]

impl Filler<HFEntityLink, HFEntityLink> for HFEntityLink[src]

impl Filler<HFEntityPositionLink, HFEntityPositionLink> for HFEntityPositionLink[src]

impl Filler<HFEntityReputation, HFEntityReputation> for HFEntityReputation[src]

impl Filler<HFEntitySquadLink, HFEntitySquadLink> for HFEntitySquadLink[src]

impl Filler<HFHonorEntity, HFHonorEntity> for HFHonorEntity[src]

impl Filler<HFIntrigueActor, HFIntrigueActor> for HFIntrigueActor[src]

impl Filler<HFIntriguePlot, HFIntriguePlot> for HFIntriguePlot[src]

impl Filler<HFLink, HFLink> for HFLink[src]

impl Filler<HFPlotActor, HFPlotActor> for HFPlotActor[src]

impl Filler<HFRelationshipProfileHF, HFRelationshipProfileHF> for HFRelationshipProfileHF[src]

impl Filler<HFSiteLink, HFSiteLink> for HFSiteLink[src]

impl Filler<HFSiteProperty, HFSiteProperty> for HFSiteProperty[src]

impl Filler<HFSkill, HFSkill> for HFSkill[src]

impl Filler<HFVagueRelationship, HFVagueRelationship> for HFVagueRelationship[src]

impl Filler<HistoricalFigure, HistoricalFigure> for HistoricalFigure[src]

impl Filler<Identity, Identity> for Identity[src]

impl Filler<Landmass, Landmass> for Landmass[src]

impl Filler<LinkHEHF, LinkHEHF> for LinkHEHF[src]

impl Filler<MountainPeak, MountainPeak> for MountainPeak[src]

impl Filler<MusicalForm, MusicalForm> for MusicalForm[src]

impl Filler<PoeticForm, PoeticForm> for PoeticForm[src]

impl Filler<Region, Region> for Region[src]

impl Filler<River, River> for River[src]

impl Filler<Site, Site> for Site[src]

impl Filler<SiteProperty, SiteProperty> for SiteProperty[src]

impl Filler<Structure, Structure> for Structure[src]

impl Filler<DFWorld, DFWorld> for DFWorld[src]

impl Filler<UndergroundRegion, UndergroundRegion> for UndergroundRegion[src]

impl Filler<WorldConstruction, WorldConstruction> for WorldConstruction[src]

impl Filler<DFWorldInfo, DFWorldInfo> for DFWorldInfo[src]

impl Filler<WCReference, WCReference> for WCReference[src]

impl Filler<WCStyle, WCStyle> for WCStyle[src]

impl Filler<WrittenContent, WrittenContent> for WrittenContent[src]

impl Filler<Coordinate, Coordinate> for Coordinate[src]

impl Filler<Path, Path> for Path[src]

impl Filler<Rectangle, Rectangle> for Rectangle[src]

impl Filler<SiteMapImage, SiteMapImage> for SiteMapImage[src]

impl Filler<MapImage, MapImage> for MapImage[src]

Loading content...