lyrical_meter/
lyrical_meter.rs1crate::ix!();
2
3#[derive(Default,ItemWithFeatures,RandConstruct,Hash,Debug,Clone,Serialize,Deserialize,PartialEq,Eq)]
4#[ai("A Lyrical meter, consisting of a foot and a line length.")]
5#[ai(Display)]
6pub struct LyricalMeter {
7 foot: MetricalFoot,
8
9 #[rand_construct(psome=0.5)]
10 #[ai(feature_if_none="The number of feet per line is flexible.")]
11 length: Option<LineLength>,
12}
13
14impl LyricalMeter {
15 pub fn builder() -> LyricalMeterBuilder {
17 LyricalMeterBuilder::default()
18 }
19
20 pub fn foot(&self) -> &MetricalFoot {
22 &self.foot
23 }
24
25 pub fn length(&self) -> Option<&LineLength> {
27 self.length.as_ref()
28 }
29
30 pub fn set_foot(&mut self, foot: MetricalFoot) -> &mut Self {
32 self.foot = foot;
33 self
34 }
35
36 pub fn set_length(&mut self, length: Option<LineLength>) -> &mut Self {
38 self.length = length;
39 self
40 }
41}