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 TextMetrics
pub fn get_width(&self) -> f64
[src]
pub fn get_width(&self) -> f64
Contains the text's advance width (the width of that inline box) in CSS pixels.
Trait Implementations
impl Clone for TextMetrics
[src]
impl Clone for TextMetrics
fn clone(&self) -> TextMetrics
[src]
fn clone(&self) -> TextMetrics
Returns 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 TextMetrics
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl InstanceOf for TextMetrics
[src]
impl InstanceOf for TextMetrics
fn instance_of(reference: &Reference) -> bool
[src]
fn instance_of(reference: &Reference) -> bool
Checks whenever a given Reference if of type Self
.
impl AsRef<Reference> for TextMetrics
[src]
impl AsRef<Reference> for TextMetrics
impl ReferenceType for TextMetrics
[src]
impl ReferenceType for TextMetrics
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
Converts 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 Reference
fn from(value: TextMetrics) -> Self
[src]
fn from(value: TextMetrics) -> Self
Performs the conversion.
impl TryFrom<TextMetrics> for Reference
[src]
impl TryFrom<TextMetrics> for Reference
type 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 TextMetrics
type 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 TextMetrics
type 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 TextMetrics
type 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 TextMetrics
type 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 TextMetrics
Auto Trait Implementations
impl Send for TextMetrics
impl Send for TextMetrics
impl Sync for TextMetrics
impl Sync for TextMetrics