style/values/generics/
url.rs1use crate::derives::*;
8
9#[derive(
11 Animate,
12 Clone,
13 ComputeSquaredDistance,
14 Debug,
15 MallocSizeOf,
16 PartialEq,
17 Parse,
18 SpecifiedValueInfo,
19 ToAnimatedValue,
20 ToAnimatedZero,
21 ToComputedValue,
22 ToCss,
23 ToResolvedValue,
24 ToShmem,
25 ToTyped,
26)]
27#[repr(C, u8)]
28#[typed(todo_derive_fields)]
29pub enum GenericUrlOrNone<U> {
30 None,
32 Url(U),
34}
35
36pub use self::GenericUrlOrNone as UrlOrNone;
37
38impl<Url> UrlOrNone<Url> {
39 pub fn none() -> Self {
41 UrlOrNone::None
42 }
43
44 pub fn is_none(&self) -> bool {
46 match *self {
47 UrlOrNone::None => true,
48 UrlOrNone::Url(..) => false,
49 }
50 }
51}