[][src]Struct casperlabs_types::URef

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.

Methods

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) -> Option<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 as_string(&self) -> String[src]

Formats the address and access rights of the URef in an unique way that could be used as a name when storing the given URef in a global state.

Trait Implementations

impl CLTyped for URef[src]

impl Clone for URef[src]

impl Copy for URef[src]

impl Debug for URef[src]

impl Display for URef[src]

impl Eq for URef[src]

impl From<PurseId> 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 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> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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, 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.