Struct casper_types::URef[][src]

pub struct 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 CLValues, or smart contracts.

Implementations

impl URef[src]

pub const 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 DataSize for URef[src]

impl Debug for URef[src]

impl Default for URef[src]

impl<'de> Deserialize<'de> for URef[src]

impl Display for URef[src]

impl Eq for URef[src]

impl From<URef> for Key[src]

impl FromBytes for URef[src]

impl Hash for URef[src]

impl Ord for URef[src]

impl PartialEq<URef> for URef[src]

impl PartialOrd<URef> for URef[src]

impl Serialize for URef[src]

impl StructuralEq for URef[src]

impl StructuralPartialEq for URef[src]

impl ToBytes for URef[src]

impl TryFrom<Key> for URef[src]

type Error = ApiError

The type returned in the event of a conversion error.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,