Struct Stack
Constructors
Name | Description |
this
()
|
Stack must always be initialized with the right size constraints
|
this
(StackMaxTotalSize, StackMaxItemSize)
|
Initializes the Stack with the configured consensus limits.
|
Methods
Name | Description |
canPush
(data)
|
Checks if the provided data can be pushed to the stack.
|
copy
()
|
|
count
()
|
Get the number of items on the stack. It's typed as a ulong to prevent
introducing platform-dependent behavior if the count ends up being
used in any opcodes (for example hashing).
|
empty
()
|
|
opSlice
()
|
|
peek
()
|
Returns the top item from the stack without popping it.
Client code must check empty() first.
|
pop
()
|
Pops an item from the stack and returns it.
Client code must check empty() first.
|
push
(data)
|
Pushes the value to the stack.
|