Struct libreda_db::layout::prelude::Text [−][src]
pub struct Text<T, S = String> where
T: CoordinateType, { /* fields omitted */ }
Expand description
A text is a point associated with a string. This struct does not define how the text should be rendered on screen.
Implementations
Methods from Deref<Target = String>
Extracts a string slice containing the entire String
.
Examples
Basic usage:
let s = String::from("foo");
assert_eq!("foo", s.as_str());
Returns this String
’s capacity, in bytes.
Examples
Basic usage:
let s = String::with_capacity(10);
assert!(s.capacity() >= 10);
Returns the length of this String
, in bytes, not char
s or
graphemes. In other words, it might not be what a human considers the
length of the string.
Examples
Basic usage:
let a = String::from("foo");
assert_eq!(a.len(), 3);
let fancy_f = String::from("ƒoo");
assert_eq!(fancy_f.len(), 4);
assert_eq!(fancy_f.chars().count(), 3);
Trait Implementations
impl<'de, T, S> Deserialize<'de> for Text<T, S> where
T: CoordinateType + Deserialize<'de>,
S: Deserialize<'de>,
impl<'de, T, S> Deserialize<'de> for Text<T, S> where
T: CoordinateType + Deserialize<'de>,
S: Deserialize<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Text<T, S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Text<T, S>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Display format of the text label.
Point wise transformation for a single point.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Return the bounding box of this geometry if a bounding box is defined.
impl<T, Dst, S> TryCastCoord<T, Dst> for Text<T, S> where
T: CoordinateType + NumCast,
Dst: CoordinateType + NumCast,
S: Clone,
impl<T, Dst, S> TryCastCoord<T, Dst> for Text<T, S> where
T: CoordinateType + NumCast,
Dst: CoordinateType + NumCast,
S: Clone,
Auto Trait Implementations
impl<T, S> RefUnwindSafe for Text<T, S> where
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, S> UnwindSafe for Text<T, S> where
S: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Rotate the geometrical shape by a multiple of 90 degrees.