Function gtld_data::get_by_kind
[−]
[src]
pub fn get_by_kind<'a>(kind: GtldKind) -> Vec<Gtld<'a>>
Retrieves all Gtld
s defined by the gtld_data::all()
method given a
GtldKind
enum value. For example, passing a GtldKind::Generic
will
return all Gtld
s that have a kind
value of GtldKind::Generic
.
Examples
Retrieve all Gtld
s with a kind
of GtldKind::Generic
:
use gtld_data::{GtldKind, get_by_kind}; let generics = get_by_kind(GtldKind::Generic); assert!(generics.len() > 0);
Alternatively the same can be done for all values of GtldKind
, for
example:
use gtld_data::{GtldKind, get_by_kind}; let sponsored = get_by_kind(GtldKind::Sponsored); assert!(sponsored.len() > 0);