[−][src]Struct casper_types::URef
Represents an unforgeable reference, containing an address in the network's global storage and
the AccessRights
of the reference.
A URef
can be used to index entities such as CLValue
s, or smart contracts.
Implementations
impl URef
[src]
pub fn new(address: [u8; 32], access_rights: AccessRights) -> Self
[src]
Constructs a URef
from an address and access rights.
pub fn addr(&self) -> [u8; 32]
[src]
Returns the address of this URef
.
pub fn access_rights(&self) -> AccessRights
[src]
Returns the access rights of this URef
.
pub fn with_access_rights(self, access_rights: AccessRights) -> Self
[src]
Returns a new URef
with the same address and updated access rights.
pub fn remove_access_rights(self) -> Self
[src]
Removes the access rights from this URef
.
pub fn is_readable(self) -> bool
[src]
Returns true
if the access rights are Some
and
is_readable
is true
for them.
pub fn into_read(self) -> URef
[src]
Returns a new URef
with the same address and AccessRights::READ
permission.
pub fn into_read_add_write(self) -> URef
[src]
Returns a new URef
with the same address and AccessRights::READ_ADD_WRITE
permission.
pub fn is_writeable(self) -> bool
[src]
Returns true
if the access rights are Some
and
is_writeable
is true
for them.
pub fn is_addable(self) -> bool
[src]
Returns true
if the access rights are Some
and is_addable
is true
for them.
pub fn to_formatted_string(&self) -> String
[src]
Formats the address and access rights of the URef
in a unique way that could be used as
a name when storing the given URef
in a global state.
pub fn from_formatted_str(input: &str) -> Result<Self, FromStrError>
[src]
Parses a string formatted as per Self::to_formatted_string()
into a URef
.
Trait Implementations
impl CLTyped for URef
[src]
impl Clone for URef
[src]
impl Copy for URef
[src]
impl Debug for URef
[src]
impl Default for URef
[src]
impl<'de> Deserialize<'de> for URef
[src]
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
[src]
impl Display for URef
[src]
impl Eq for URef
[src]
impl From<URef> for Key
[src]
impl FromBytes for URef
[src]
fn from_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), Error>
[src]
fn from_vec(bytes: Vec<u8>) -> Result<(Self, Vec<u8>), Error>
[src]
impl Hash for URef
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for URef
[src]
fn cmp(&self, other: &URef) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<URef> for URef
[src]
impl PartialOrd<URef> for URef
[src]
fn partial_cmp(&self, other: &URef) -> Option<Ordering>
[src]
fn lt(&self, other: &URef) -> bool
[src]
fn le(&self, other: &URef) -> bool
[src]
fn gt(&self, other: &URef) -> bool
[src]
fn ge(&self, other: &URef) -> bool
[src]
impl Serialize for URef
[src]
impl StructuralEq for URef
[src]
impl StructuralPartialEq for URef
[src]
impl ToBytes for URef
[src]
fn to_bytes(&self) -> Result<Vec<u8>, Error>
[src]
fn serialized_length(&self) -> usize
[src]
fn into_bytes(self) -> Result<Vec<u8>, Error> where
Self: Sized,
[src]
Self: Sized,
impl TryFrom<Key> for URef
[src]
Auto Trait Implementations
impl RefUnwindSafe for URef
impl Send for URef
impl Sync for URef
impl Unpin for URef
impl UnwindSafe for URef
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,