32 lines
549 B
Rust
32 lines
549 B
Rust
enum Status {
|
|
BUISY,
|
|
FREE,
|
|
DELETED,
|
|
}
|
|
|
|
const SIZE: usize = 15;
|
|
|
|
pub struct Str {
|
|
_data: Vec<char>,
|
|
_stats: Vec<Status>,
|
|
_size: usize,
|
|
_capacity: usize,
|
|
}
|
|
|
|
impl Str {
|
|
pub fn new() -> Self {
|
|
Self {
|
|
_data: Vec::with_capacity(SIZE),
|
|
_stats: {
|
|
let mut data = Vec::new();
|
|
for i in 0..SIZE {
|
|
data.push(Status::FREE);
|
|
}
|
|
data
|
|
},
|
|
_size: 0,
|
|
_capacity: SIZE,
|
|
}
|
|
}
|
|
}
|