pub struct Keywords {
pub keywords: Vec<&'static str>,
}
Fields§
§keywords: Vec<&'static str>
Implementations§
source§impl Keywords
impl Keywords
sourcepub fn new(keywords: Vec<&'static str>) -> Self
pub fn new(keywords: Vec<&'static str>) -> Self
Create a new set of keywords.
Keywords vector is limited to a maximum of 5 keyword.
Returns a Keywords instance.
Example
use rtrend::Keywords;
let keywords = Keywords::new(vec!["Unicorn","Labradoodle","Pikachu"]);
Panics
A vector of length greater than 5 will panic.
ⓘ
let seven_dwarf = vec!["Bashful","Doc", "Dopey","Grumpy","Happy", "Sleepy", "Sneezy"];
let keywords = Keywords::new(seven_dwarf);
A vector without keywords will also panic.
ⓘ
let keywords = Keywords::new(vec![]);
Examples found in repository?
More examples
Additional examples can be found in:
Trait Implementations§
source§impl Ord for Keywords
impl Ord for Keywords
source§impl PartialEq<Keywords> for Keywords
impl PartialEq<Keywords> for Keywords
source§impl PartialOrd<Keywords> for Keywords
impl PartialOrd<Keywords> for Keywords
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Keywords
impl StructuralEq for Keywords
impl StructuralPartialEq for Keywords
Auto Trait Implementations§
impl RefUnwindSafe for Keywords
impl Send for Keywords
impl Sync for Keywords
impl Unpin for Keywords
impl UnwindSafe for Keywords
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.