Struct bee_crypto::ternary::bigint::t242::BTRIT_MIN[][src]

pub struct BTRIT_MIN { /* fields omitted */ }
👎 Deprecated:

bee-crypto will not be supported in future versions. You can use functions from iota-crypto instead.

Expand description

T242 balanced trits represented minimum value.

Methods from Deref<Target = TritBuf<T1B1Buf<T>>>

Clears the buffer, removing all values. Note that this method has no effect on the allocated capacity of the buffer.

Push a trit to the back of this TritBuf.

Pop a trit from the back of this TritBuf, returning it if successful.

Append a trit slice to the end of this TritBuf.

Extracts a trit slice containing the data within this buffer.

Note that TritBuf dereferences to Trits anyway, so it’s usually sufficient to take a reference to TritBuf or to just call &Trits methods on it rather than explicitly calling this method first.

Extracts a mutable trit slice containing the data within this buffer.

Note that TritBuf dereferences to Trits anyway, so it’s usually sufficient to take a reference to TritBuf or to just call &mut Trits methods on it rather explicitly calling this method first.

Returns the number of trits the TritBuf can hold without reallocating.

Pad the trit buffer with Btrit::Zero until the buffer’s length is a multiple of 3.

This method is often used in conjunction with Trits::as_trytes.

Methods from Deref<Target = Trits<<T as RawEncodingBuf>::Slice>>

Returns true if the trit slice is empty.

Returns the number of trits in this trit slice.

Interpret this slice as an (core::i8) slice.

Panics

This function will panic if the slice is not byte-aligned.

Fetch the trit at the given index of this trit slice without first checking whether the index is in bounds. Providing an index that is not less than the length of this slice is undefined behaviour.

This is perhaps the ‘least bad’ unsafe function in this crate: not because any form of undefined behaviour is better or worse than another (after all, the point of undefined behaviour is that it is undefined) but because it’s the easiest to use correctly.

Safety

An index with a value less then the result of Trits::len must be used. Any other value is undefined behaviour.

Fetch the trit at the given index of this trit slice, if the index is valid.

Returns an iterator over the trits in this slice.

Using this function is significantly faster than calling Trits::get in a loop and should be used where possible.

Returns a subslice of this slice with the given range of trits.

Panics

This function will panic if called with a range that contains indices outside this slice, or the start of the range is greater than its end.

Copy the contents of this trit slice into a new TritBuf with the same encoding. This function is analogous to to_vec method implemented on ordinary slices.

Return an iterator over distinct, non-overlapping subslices of this trit slice, each with the given chunk length. If the length of the trit slice is not a multiple of the given chunk length, the last slice provided by the iterator will be smaller to compensate.

Panics

This function will panic if the given chunk length is 0.

Encode the contents of this trit slice into a TritBuf with a different encoding.

Returns an iterator over the trytes represented within this slice.

For encodings that are representation-compatible with trytes, such as T3B1, use Trits::as_trytes instead since it is faster and more capable.

View this trit slice as an ordinary slice of trits.

Interpret this trit slice as a Tryte slice.

Panics

This function will panic if the length of the slice is not a multiple of 3, or if the slice is not byte-aligned.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.