mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Impl DynNode
This commit is contained in:
@@ -7,8 +7,11 @@ use std::{
|
||||
|
||||
pub trait BorrowStack<'n> {
|
||||
type Item;
|
||||
/// # Safety
|
||||
unsafe fn push(&'n self, value: Self::Item);
|
||||
/// # Safety
|
||||
unsafe fn pop(&'n self);
|
||||
/// # Safety
|
||||
unsafe fn get(&'n self) -> &'n [Self::Item];
|
||||
}
|
||||
|
||||
@@ -37,6 +40,10 @@ impl<'n, T: Unpin> FixedSizeStack<'n, T> {
|
||||
pub fn len(&self) -> usize {
|
||||
self.len.load(Ordering::SeqCst)
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.len.load(Ordering::SeqCst) == 0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'n, T> BorrowStack<'n> for FixedSizeStack<'n, T> {
|
||||
|
||||
Reference in New Issue
Block a user