pub struct SafeAreaInset {
pub top: f64,
pub bottom: f64,
pub left: f64,
pub right: f64,
}
Expand description
Safe area insets reported by Telegram.
§Examples
use telegram_webapp_sdk::webapp::{SafeAreaInset, TelegramWebApp};
if let Some(app) = TelegramWebApp::instance() {
if let Some(SafeAreaInset {
top,
bottom,
..
}) = app.safe_area_inset()
{
let _ = (top, bottom);
}
}
Fields§
§top: f64
Distance from the top edge in CSS pixels.
bottom: f64
Distance from the bottom edge in CSS pixels.
left: f64
Distance from the left edge in CSS pixels.
right: f64
Distance from the right edge in CSS pixels.
Trait Implementations§
Source§impl Clone for SafeAreaInset
impl Clone for SafeAreaInset
Source§fn clone(&self) -> SafeAreaInset
fn clone(&self) -> SafeAreaInset
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SafeAreaInset
impl Debug for SafeAreaInset
Source§impl PartialEq for SafeAreaInset
impl PartialEq for SafeAreaInset
impl Copy for SafeAreaInset
impl StructuralPartialEq for SafeAreaInset
Auto Trait Implementations§
impl Freeze for SafeAreaInset
impl RefUnwindSafe for SafeAreaInset
impl Send for SafeAreaInset
impl Sync for SafeAreaInset
impl Unpin for SafeAreaInset
impl UnwindSafe for SafeAreaInset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more