mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-03 21:08:18 +00:00
Impl DynNode
This commit is contained in:
parent
f73836b838
commit
71f12db1e6
16 changed files with 433 additions and 84 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue