use crate::scope::{NativeScopePop, NativeScopeToken};
use crate::ui::Ui;
#[must_use]
#[doc(alias = "EndTable")]
pub struct TableToken<'ui> {
scope: NativeScopeToken<'ui>,
}
impl<'ui> TableToken<'ui> {
pub(crate) fn new(ui: &'ui Ui) -> Self {
Self {
scope: ui.begin_native_scope(NativeScopePop::EndTable, "TableToken"),
}
}
pub fn end(self) {
}
}
impl<'ui> Drop for TableToken<'ui> {
fn drop(&mut self) {
self.scope.finish();
}
}
pub(super) struct TableChannelGuard<'ui> {
scope: NativeScopeToken<'ui>,
}
impl<'ui> TableChannelGuard<'ui> {
pub(super) fn background(ui: &'ui Ui) -> Self {
Self {
scope: ui.begin_native_scope(
NativeScopePop::PopTableBackgroundChannel,
"table background channel",
),
}
}
pub(super) fn column(ui: &'ui Ui) -> Self {
Self {
scope: ui.begin_native_scope(
NativeScopePop::PopTableColumnChannel,
"table column channel",
),
}
}
}
impl Drop for TableChannelGuard<'_> {
fn drop(&mut self) {
self.scope.finish();
}
}