Struct rune::Storage [−][src]
Storage for synthetic language items.
Implementations
impl Storage
[src]
pub fn insert_number<N>(&self, number: N) -> usize where
Number: From<N>,
[src]
Number: From<N>,
Construct a new number.
The number will be stored in this storage, and will be synthetic (rather than from the source).
pub fn insert_str(&self, string: &str) -> usize
[src]
Insert the given text into storage and return its id.
This will reuse old storage slots that already contains the given string.
pub fn insert_string(&self, string: String) -> usize
[src]
Insert the given owned string into storage and return its id.
This will reuse old storage slots that already contains the given string.
pub fn insert_byte_string(&self, bytes: &[u8]) -> usize
[src]
Insert the given text into storage and return its id.
This will reuse old storage slots that already contains the given byte string.
pub fn with_byte_string<F, O>(&self, id: usize, with: F) -> Option<O> where
F: FnOnce(&[u8]) -> O,
[src]
F: FnOnce(&[u8]) -> O,
Get the content of the byte string with the specified id and apply the given operation over it.
pub fn get_string(&self, id: usize) -> Option<String>
[src]
Get the content of the string with the specified id.
pub fn with_string<F, O>(&self, id: usize, with: F) -> Option<O> where
F: FnOnce(&str) -> O,
[src]
F: FnOnce(&str) -> O,
Get the content of the string with the specified id and apply the given operation over it.
pub fn get_byte_string(&self, id: usize) -> Option<Vec<u8>>
[src]
Get the content of the byte string with the specified id.
pub fn get_number(&self, id: usize) -> Option<Number>
[src]
Get the content of the number with the specified id.
pub fn with_number<F, O>(&self, id: usize, with: F) -> Option<O> where
F: FnOnce(&Number) -> O,
[src]
F: FnOnce(&Number) -> O,
Get the content of the number with the specified id and apply the given operation over it.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Storage
impl !Send for Storage
impl !Sync for Storage
impl Unpin for Storage
impl !UnwindSafe for Storage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,