to_slice declare protected

This commit is contained in:
Didactic Drunk 2021-06-16 14:20:11 -07:00
parent 13b6c20e7b
commit 1cbb5c7b90
3 changed files with 3 additions and 2 deletions

View File

@ -174,7 +174,7 @@ class MySecret
# optionally mlock
end
def to_slice(& : Bytes -> Nil)
protected def to_slice(& : Bytes -> Nil)
# The yielded Slice only needs to be valid within the block
# yield Slice.new(pointer, size)
ensure

View File

@ -6,6 +6,7 @@ module Crypto::Secret
# * Not locked in memory
# * Not access protected
# * No guard pages
# * Hours of fun
class Bidet
include Stateless

View File

@ -90,7 +90,7 @@ module Crypto::Secret
abstract def readonly
abstract def noaccess
abstract def to_slice(& : Bytes -> Nil)
protected abstract def to_slice(& : Bytes -> Nil)
abstract def bytesize : Int32
macro delegate_to_slice(to object)