pub enum ElementRef<V0, V1> {
Shape(V0),
Text(V1),
}
Expand description
A primitive layout element.
Variants§
Implementations§
Source§impl<V0, V1> ElementRef<V0, V1>
impl<V0, V1> ElementRef<V0, V1>
Sourcepub fn unwrap_shape(self) -> V0
pub fn unwrap_shape(self) -> V0
Returns the value contained in this variant.
§Panics
Panics if the enum value is not of the expected variant.
Sourcepub fn get_shape(&self) -> Option<&V0>
pub fn get_shape(&self) -> Option<&V0>
Returns a reference to the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
Sourcepub fn into_shape(self) -> Option<V0>
pub fn into_shape(self) -> Option<V0>
Returns the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
Sourcepub fn unwrap_text(self) -> V1
pub fn unwrap_text(self) -> V1
Returns the value contained in this variant.
§Panics
Panics if the enum value is not of the expected variant.
Sourcepub fn get_text(&self) -> Option<&V1>
pub fn get_text(&self) -> Option<&V1>
Returns a reference to the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
Sourcepub fn into_text(self) -> Option<V1>
pub fn into_text(self) -> Option<V1>
Returns the value contained in this variant.
Returns None
if the enum value is not of the expected variant.
Sourcepub fn as_ref(&self) -> ElementRef<&V0, &V1>
pub fn as_ref(&self) -> ElementRef<&V0, &V1>
Converts generic types to references.
For example, transforms the type parameter T
to &T
.
Sourcepub fn as_mut(&mut self) -> ElementRef<&mut V0, &mut V1>
pub fn as_mut(&mut self) -> ElementRef<&mut V0, &mut V1>
Converts generic types to mutable references.
For example, transforms the type parameter T
to &mut T
.