Struct stdweb::web::TextMetrics [−][src]
pub struct TextMetrics(_);
The TextMetrics struct represents the dimension of a text in the canvas, as created by the CanvasRenderingContext2D.measureText() method.
Methods
impl TextMetrics[src]
impl TextMetricspub fn get_width(&self) -> f64[src]
pub fn get_width(&self) -> f64Contains the text's advance width (the width of that inline box) in CSS pixels.
Trait Implementations
impl Clone for TextMetrics[src]
impl Clone for TextMetricsfn clone(&self) -> TextMetrics[src]
fn clone(&self) -> TextMetricsReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for TextMetrics[src]
impl Debug for TextMetricsfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl InstanceOf for TextMetrics[src]
impl InstanceOf for TextMetricsfn instance_of(reference: &Reference) -> bool[src]
fn instance_of(reference: &Reference) -> boolChecks whenever a given Reference if of type Self.
impl AsRef<Reference> for TextMetrics[src]
impl AsRef<Reference> for TextMetricsimpl ReferenceType for TextMetrics[src]
impl ReferenceType for TextMetricsunsafe fn from_reference_unchecked(reference: Reference) -> Self[src]
unsafe fn from_reference_unchecked(reference: Reference) -> SelfConverts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more
impl From<TextMetrics> for Reference[src]
impl From<TextMetrics> for Referencefn from(value: TextMetrics) -> Self[src]
fn from(value: TextMetrics) -> SelfPerforms the conversion.
impl TryFrom<TextMetrics> for Reference[src]
impl TryFrom<TextMetrics> for Referencetype Error = Void
The type returned in the event of a conversion error.
fn try_from(value: TextMetrics) -> Result<Self, Self::Error>[src]
fn try_from(value: TextMetrics) -> Result<Self, Self::Error>Performs the conversion.
impl TryFrom<Reference> for TextMetrics[src]
impl TryFrom<Reference> for TextMetricstype Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>[src]
fn try_from(reference: Reference) -> Result<Self, Self::Error>Performs the conversion.
impl<'_r> TryFrom<&'_r Reference> for TextMetrics[src]
impl<'_r> TryFrom<&'_r Reference> for TextMetricstype Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>[src]
fn try_from(reference: &Reference) -> Result<Self, Self::Error>Performs the conversion.
impl TryFrom<Value> for TextMetrics[src]
impl TryFrom<Value> for TextMetricstype Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>[src]
fn try_from(value: Value) -> Result<Self, Self::Error>Performs the conversion.
impl<'_r> TryFrom<&'_r Value> for TextMetrics[src]
impl<'_r> TryFrom<&'_r Value> for TextMetricstype Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>[src]
fn try_from(value: &Value) -> Result<Self, Self::Error>Performs the conversion.
impl JsSerialize for TextMetrics[src]
impl JsSerialize for TextMetricsAuto Trait Implementations
impl Send for TextMetrics
impl Send for TextMetricsimpl Sync for TextMetrics
impl Sync for TextMetrics