Struct SwhGraphProperties

Source
pub struct SwhGraphProperties<MAPS: MaybeMaps, TIMESTAMPS: MaybeTimestamps, PERSONS: MaybePersons, CONTENTS: MaybeContents, STRINGS: MaybeStrings, LABELNAMES: MaybeLabelNames> { /* private fields */ }
Expand description

Properties on graph nodes

This structures has many type parameters, to allow loading only some properties, and checking at compile time that only loaded properties are accessed.

Extra properties can be loaded, following the builder pattern on the owning graph. For example, this does not compile:

use swh_graph::graph::SwhGraphWithProperties;
use swh_graph::mph::DynMphf;
use swh_graph::SwhGraphProperties;

swh_graph::graph::SwhUnidirectionalGraph::new(PathBuf::from("./graph"))
    .expect("Could not load graph")
    .init_properties()
    .properties()
    .author_timestamp(42);

but this does:

use swh_graph::graph::SwhGraphWithProperties;
use swh_graph::mph::DynMphf;
use swh_graph::SwhGraphProperties;

swh_graph::graph::SwhUnidirectionalGraph::new(PathBuf::from("./graph"))
    .expect("Could not load graph")
    .init_properties()
    .load_properties(SwhGraphProperties::load_timestamps)
    .expect("Could not load timestamp properties")
    .properties()
    .author_timestamp(42);

Implementations§

Source§

impl<TIMESTAMPS: MaybeTimestamps, PERSONS: MaybePersons, CONTENTS: MaybeContents, STRINGS: MaybeStrings, LABELNAMES: MaybeLabelNames> SwhGraphProperties<NoMaps, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>

Source

pub fn load_maps<MPHF: LoadableSwhidMphf>( self, ) -> Result<SwhGraphProperties<MappedMaps<MPHF>, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>>

Source

pub fn with_maps<MAPS: MaybeMaps>( self, maps: MAPS, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>>

Alternative to load_maps that allows using arbitrary maps implementations

Source§

impl<MAPS: Maps, TIMESTAMPS: MaybeTimestamps, PERSONS: MaybePersons, CONTENTS: MaybeContents, STRINGS: MaybeStrings, LABELNAMES: MaybeLabelNames> SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>

Functions to map between SWHID and node id.

Only available after calling load_contents or load_all_properties

Source

pub unsafe fn node_id_unchecked(&self, swhid: &SWHID) -> NodeId

Returns the node id of the given SWHID

May return the id of a random node if the SWHID does not exist in the graph.

§Safety

Undefined behavior if the swhid does not exist.

Source

pub fn node_id<T: TryInto<SWHID>>( &self, swhid: T, ) -> Result<NodeId, NodeIdFromSwhidError<<T as TryInto<SWHID>>::Error>>

Returns the node id of the given SWHID, or None if it does not exist.

Source

pub fn node_id_from_string_swhid<T: AsRef<str>>( &self, swhid: T, ) -> Result<NodeId, NodeIdFromSwhidError<StrSWHIDDeserializationError>>

Specialized version of node_id when the SWHID is a string

Under the hood, when using GOVMPH, node_id serializes the SWHID to a string, which can be bottleneck. This function skips the serialization by working directly on the string.

Source

pub fn swhid(&self, node_id: NodeId) -> SWHID

Returns the SWHID of a given node

§Panics

If the node id does not exist.

Source

pub fn try_swhid(&self, node_id: NodeId) -> Result<SWHID, OutOfBoundError>

Returns the SWHID of a given node, or None if the node id does not exist

Source

pub fn node_type(&self, node_id: NodeId) -> NodeType

Returns the type of a given node

§Panics

If the node id does not exist.

Source

pub fn try_node_type( &self, node_id: NodeId, ) -> Result<NodeType, OutOfBoundError>

Returns the type of a given node, or None if the node id does not exist

Source§

impl<MAPS: MaybeMaps, PERSONS: MaybePersons, CONTENTS: MaybeContents, STRINGS: MaybeStrings, LABELNAMES: MaybeLabelNames> SwhGraphProperties<MAPS, NoTimestamps, PERSONS, CONTENTS, STRINGS, LABELNAMES>

Source

pub fn load_timestamps( self, ) -> Result<SwhGraphProperties<MAPS, MappedTimestamps, PERSONS, CONTENTS, STRINGS, LABELNAMES>>

Source

pub fn opt_load_timestamps( self, ) -> Result<SwhGraphProperties<MAPS, OptMappedTimestamps, PERSONS, CONTENTS, STRINGS, LABELNAMES>>

Equivalent to Self::load_timestamps that does not require all files to be present

Source

pub fn with_timestamps<TIMESTAMPS: MaybeTimestamps>( self, timestamps: TIMESTAMPS, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>>

Alternative to load_timestamps that allows using arbitrary timestamps implementations

Source§

impl<MAPS: MaybeMaps, TIMESTAMPS: OptTimestamps, PERSONS: MaybePersons, CONTENTS: MaybeContents, STRINGS: MaybeStrings, LABELNAMES: MaybeLabelNames> SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>

Functions to access timestamps of revision and release nodes

Only available after calling load_timestamps or load_all_properties

Source

pub fn author_timestamp( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<i64>, TIMESTAMPS>

Returns the number of seconds since Epoch that a release or revision was authored at

§Panics

If the node id does not exist

Source

pub fn try_author_timestamp( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<i64>, OutOfBoundError>, TIMESTAMPS>

Returns the number of seconds since Epoch that a release or revision was authored at

Returns Err if the node id is unknown, and Ok(None) if the node has no author timestamp

Source

pub fn author_timestamp_offset( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<i16>, TIMESTAMPS>

Returns the UTC offset in minutes of a release or revision’s authorship date

§Panics

If the node id does not exist

Source

pub fn try_author_timestamp_offset( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<i16>, OutOfBoundError>, TIMESTAMPS>

Returns the UTC offset in minutes of a release or revision’s authorship date

Returns Err if the node id is unknown, and Ok(None) if the node has no author timestamp

Source

pub fn committer_timestamp( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<i64>, TIMESTAMPS>

Returns the number of seconds since Epoch that a revision was committed at

§Panics

If the node id does not exist

Source

pub fn try_committer_timestamp( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<i64>, OutOfBoundError>, TIMESTAMPS>

Returns the number of seconds since Epoch that a revision was committed at

Returns Err if the node id is unknown, and Ok(None) if the node has no committer timestamp

Source

pub fn committer_timestamp_offset( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<i16>, TIMESTAMPS>

Returns the UTC offset in minutes of a revision’s committer date

§Panics

If the node id does not exist

Source

pub fn try_committer_timestamp_offset( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<i16>, OutOfBoundError>, TIMESTAMPS>

Returns the UTC offset in minutes of a revision’s committer date

Returns Err if the node id is unknown, and Ok(None) if the node has no committer timestamp

Source§

impl<MAPS: MaybeMaps, TIMESTAMPS: MaybeTimestamps, CONTENTS: MaybeContents, STRINGS: MaybeStrings, LABELNAMES: MaybeLabelNames> SwhGraphProperties<MAPS, TIMESTAMPS, NoPersons, CONTENTS, STRINGS, LABELNAMES>

Source

pub fn load_persons( self, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, MappedPersons, CONTENTS, STRINGS, LABELNAMES>>

Consumes a SwhGraphProperties and returns a new one with these methods available:

Source

pub fn opt_load_persons( self, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, OptMappedPersons, CONTENTS, STRINGS, LABELNAMES>>

Equivalent to Self::load_persons that does not require all files to be present

Source

pub fn with_persons<PERSONS: MaybePersons>( self, persons: PERSONS, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>>

Alternative to load_persons that allows using arbitrary persons implementations

Source§

impl<MAPS: MaybeMaps, TIMESTAMPS: MaybeTimestamps, PERSONS: OptPersons, CONTENTS: MaybeContents, STRINGS: MaybeStrings, LABELNAMES: MaybeLabelNames> SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>

Functions to access the id of the author or committer of revision/release nodes.

Only available after calling load_persons or load_all_properties

Source

pub fn author_id( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<u32>, PERSONS>

Returns the id of the author of a revision or release, if any

§Panics

If the node id does not exist

Source

pub fn try_author_id( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<u32>, OutOfBoundError>, PERSONS>

Returns the id of the author of a revision or release, if any

Returns Err if the node id does not exist, and Ok(None) if the node has no author

Source

pub fn committer_id( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<u32>, PERSONS>

Returns the id of the committer of a revision, if any

§Panics

If the node id does not exist

Source

pub fn try_committer_id( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<u32>, OutOfBoundError>, PERSONS>

Returns the id of the committer of a revision, if any

Returns None if the node id does not exist, and Ok(None) if the node has no author

Source§

impl<MAPS: MaybeMaps, TIMESTAMPS: MaybeTimestamps, PERSONS: MaybePersons, STRINGS: MaybeStrings, LABELNAMES: MaybeLabelNames> SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, NoContents, STRINGS, LABELNAMES>

Source

pub fn load_contents( self, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, MappedContents, STRINGS, LABELNAMES>>

Consumes a SwhGraphProperties and returns a new one with these methods available:

Source

pub fn opt_load_contents( self, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, OptMappedContents, STRINGS, LABELNAMES>>

Equivalent to Self::load_contents that does not require all files to be present

Source

pub fn with_contents<CONTENTS: MaybeContents>( self, contents: CONTENTS, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>>

Alternative to load_contents that allows using arbitrary contents implementations

Source§

impl<MAPS: MaybeMaps, TIMESTAMPS: MaybeTimestamps, PERSONS: MaybePersons, CONTENTS: OptContents, STRINGS: MaybeStrings, LABELNAMES: MaybeLabelNames> SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>

Functions to access properties of content nodes

Only available after calling load_contents or load_all_properties

Source

pub fn is_skipped_content( &self, node_id: NodeId, ) -> PropertiesResult<'_, bool, CONTENTS>

Returns whether the node is a skipped content

Non-content objects get a false value, like non-skipped contents.

§Panics

If the node id does not exist.

Source

pub fn try_is_skipped_content( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<bool, OutOfBoundError>, CONTENTS>

Returns whether the node is a skipped content, or Err if the node id does not exist

Non-content objects get a false value, like non-skipped contents.

Source

pub fn content_length( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<u64>, CONTENTS>

Returns the length of the given content.

May be None for skipped contents

§Panics

If the node id does not exist.

Source

pub fn try_content_length( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<u64>, OutOfBoundError>, CONTENTS>

Returns the length of the given content, or Err if the node id does not exist

May be Ok(None) for skipped contents

Source§

impl<MAPS: MaybeMaps, TIMESTAMPS: MaybeTimestamps, PERSONS: MaybePersons, CONTENTS: MaybeContents, LABELNAMES: MaybeLabelNames> SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, NoStrings, LABELNAMES>

Source

pub fn load_strings( self, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, MappedStrings, LABELNAMES>>

Source

pub fn opt_load_strings( self, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, OptMappedStrings, LABELNAMES>>

Equivalent to Self::load_strings that does not require all files to be present

Source

pub fn with_strings<STRINGS: MaybeStrings>( self, strings: STRINGS, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>>

Alternative to load_strings that allows using arbitrary strings implementations

Source§

impl<MAPS: MaybeMaps, TIMESTAMPS: MaybeTimestamps, PERSONS: MaybePersons, CONTENTS: MaybeContents, STRINGS: OptStrings, LABELNAMES: MaybeLabelNames> SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>

Functions to access message of revision/release nodes, and names of release nodes

Only available after calling load_strings or load_all_properties

Source

pub fn message_base64( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<&[u8]>, STRINGS>

Returns the base64-encoded message of a revision or release, or the base64-encoded URL of an origin

§Panics

If the node id does not exist

Source

pub fn try_message_base64( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<&[u8]>, OutOfBoundError>, STRINGS>

Returns the base64-encoded message of a revision or release

Returns Err if the node id is unknown, and Ok(None) if the node has no message.

Source

pub fn message( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<Vec<u8>>, STRINGS>

Returns the message of a revision or release, or the URL of an origin

§Panics

If the node id does not exist

Source

pub fn try_message( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<Vec<u8>>, OutOfBoundError>, STRINGS>

Returns the message of a revision or release, or the URL of an origin

Returns Err if the node id is unknown, and Ok(None) if the node has no message.

Source

pub fn tag_name_base64( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<&[u8]>, STRINGS>

Returns the tag name of a release, base64-encoded

§Panics

If the node id does not exist

Source

pub fn try_tag_name_base64( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<&[u8]>, OutOfBoundError>, STRINGS>

Returns the tag name of a release, base64-encoded

Returns Err if the node id is unknown, and Ok(None) if the node has no tag name.

Source

pub fn tag_name( &self, node_id: NodeId, ) -> PropertiesResult<'_, Option<Vec<u8>>, STRINGS>

Returns the tag name of a release

§Panics

If the node id does not exist

Source

pub fn try_tag_name( &self, node_id: NodeId, ) -> PropertiesResult<'_, Result<Option<Vec<u8>>, OutOfBoundError>, STRINGS>

Returns the tag name of a release

Returns Err if the node id is unknown, and Ok(None) if the node has no tag name.

Source§

impl<MAPS: MaybeMaps, TIMESTAMPS: MaybeTimestamps, PERSONS: MaybePersons, CONTENTS: MaybeContents, STRINGS: MaybeStrings> SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, NoLabelNames>

Source

pub fn load_label_names( self, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, MappedLabelNames>>

Consumes a SwhGraphProperties and returns a new one with this methods available:

Source

pub fn with_label_names<LABELNAMES: MaybeLabelNames>( self, label_names: LABELNAMES, ) -> Result<SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>>

Alternative to load_label_names that allows using arbitrary label_names implementations

Source§

impl<MAPS: MaybeMaps, TIMESTAMPS: MaybeTimestamps, PERSONS: MaybePersons, CONTENTS: MaybeContents, STRINGS: MaybeStrings, LABELNAMES: LabelNames> SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>

Functions to access names of arc labels.

Only available after calling load_label_names or load_all_properties.

Source

pub fn num_label_names(&self) -> u64

Returns the total number of labels in the graph

Source

pub fn iter_label_name_ids(&self) -> impl Iterator<Item = LabelNameId>

Returns an iterator on LabelNameIds for this graph

Source

pub fn par_iter_label_name_ids( &self, ) -> impl ParallelIterator<Item = LabelNameId>

Returns an iterator on LabelNameIds for this graph

Source

pub fn label_name_base64(&self, label_name_id: LabelNameId) -> Vec<u8>

Returns the base64-encoded name of an arc label

This is the file name (resp. branch name) of a label on an arc from a directory (resp. snapshot)

§Panics

If label_name_id does not exist

Source

pub fn try_label_name_base64( &self, label_name_id: LabelNameId, ) -> Result<Vec<u8>, OutOfBoundError>

Returns the base64-encoded name of an arc label

This is the file name (resp. branch name) of a label on an arc from a directory (resp. snapshot)

Source

pub fn label_name(&self, label_name_id: LabelNameId) -> Vec<u8>

Returns the name of an arc label

This is the file name (resp. branch name) of a label on an arc from a directory (resp. snapshot)

§Panics

If label_name_id does not exist

Source

pub fn try_label_name( &self, label_name_id: LabelNameId, ) -> Result<Vec<u8>, OutOfBoundError>

Returns the name of an arc label

This is the file name (resp. branch name) of a label on an arc from a directory (resp. snapshot)

Source

pub fn label_name_id( &self, name: impl AsRef<[u8]>, ) -> Result<LabelNameId, LabelIdFromNameError>

Given a branch/file name, returns the label_name id used by edges with that name, or None if it does not exist.

This is the inverse function of label_name

Unlike in Java where this function is O(1), this implementation is O(log2(num_labels)) because it uses a binary search, as the MPH function can only be read from Java.

Source§

impl SwhGraphProperties<NoMaps, NoTimestamps, NoPersons, NoContents, NoStrings, NoLabelNames>

Source

pub fn new(path: impl AsRef<Path>, num_nodes: usize) -> Self

Creates an empty SwhGraphProperties instance, which will load properties from the given path prefix.

Source

pub fn load_all<MPHF: LoadableSwhidMphf>( self, ) -> Result<AllSwhGraphProperties<MPHF>>

Consumes an empty SwhGraphProperties instance and returns a new one with all properties loaded and all methods available.

 use swh_graph::graph::SwhGraphWithProperties;
use swh_graph::mph::DynMphf;
use swh_graph::SwhGraphProperties;

SwhGraphProperties::new(PathBuf::from("./graph"), 123)
    .load_all::<DynMphf>()
    .expect("Could not load properties");

is equivalent to:

use swh_graph::mph::DynMphf;
use swh_graph::SwhGraphProperties;

SwhGraphProperties::new(PathBuf::from("./graph"), 123)
    .load_maps::<DynMphf>()
    .expect("Could not load node2swhid/swhid2node")
    .load_timestamps()
    .expect("Could not load timestamp properties")
    .load_persons()
    .expect("Could not load person properties")
    .load_contents()
    .expect("Could not load content properties")
    .load_strings()
    .expect("Could not load string properties");

Auto Trait Implementations§

§

impl<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES> !Freeze for SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>

§

impl<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES> RefUnwindSafe for SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>
where MAPS: RefUnwindSafe, TIMESTAMPS: RefUnwindSafe, PERSONS: RefUnwindSafe, CONTENTS: RefUnwindSafe, STRINGS: RefUnwindSafe, LABELNAMES: RefUnwindSafe,

§

impl<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES> Send for SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>
where MAPS: Send, TIMESTAMPS: Send, PERSONS: Send, CONTENTS: Send, STRINGS: Send, LABELNAMES: Send,

§

impl<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES> Sync for SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>
where MAPS: Sync, TIMESTAMPS: Sync, PERSONS: Sync, CONTENTS: Sync, STRINGS: Sync, LABELNAMES: Sync,

§

impl<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES> Unpin for SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>
where MAPS: Unpin, TIMESTAMPS: Unpin, PERSONS: Unpin, CONTENTS: Unpin, STRINGS: Unpin, LABELNAMES: Unpin,

§

impl<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES> UnwindSafe for SwhGraphProperties<MAPS, TIMESTAMPS, PERSONS, CONTENTS, STRINGS, LABELNAMES>
where MAPS: UnwindSafe, TIMESTAMPS: UnwindSafe, PERSONS: UnwindSafe, CONTENTS: UnwindSafe, STRINGS: UnwindSafe, LABELNAMES: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CastableFrom<T> for T

Source§

fn cast_from(value: T) -> T

Call Self as W
Source§

impl<T> CastableFrom<T> for T

Source§

fn cast_from(value: T) -> T

Call Self as W
Source§

impl<T, U> CastableInto<U> for T
where U: CastableFrom<T>,

Source§

fn cast(self) -> U

Call W::cast_from(self)
Source§

impl<T, U> CastableInto<U> for T
where U: CastableFrom<T>,

Source§

fn cast(self) -> U

Call W::cast_from(self)
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> DowncastableFrom<T> for T

Source§

fn downcast_from(value: T) -> T

Truncate the current UnsignedInt to a possibly smaller size
Source§

impl<T> DowncastableFrom<T> for T

Source§

fn downcast_from(value: T) -> T

Truncate the current UnsignedInt to a possibly smaller size
Source§

impl<T, U> DowncastableInto<U> for T
where U: DowncastableFrom<T>,

Source§

fn downcast(self) -> U

Call W::downcast_from(self)
Source§

impl<T, U> DowncastableInto<U> for T
where U: DowncastableFrom<T>,

Source§

fn downcast(self) -> U

Call W::downcast_from(self)
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

Source§

const WITNESS: W = W::MAKE

A constant of the type witness
Source§

impl<T> Identity for T
where T: ?Sized,

Source§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
Source§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Splat<T> for T

Source§

fn splat(value: T) -> T

Source§

impl<T> Splat<T> for T

Source§

fn splat(value: T) -> T

Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> To<T> for T

Source§

fn to(self) -> T

Source§

impl<T> To<T> for T

Source§

fn to(self) -> T

Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UpcastableFrom<T> for T

Source§

fn upcast_from(value: T) -> T

Extend the current UnsignedInt to a possibly bigger size.
Source§

impl<T> UpcastableFrom<T> for T

Source§

fn upcast_from(value: T) -> T

Extend the current UnsignedInt to a possibly bigger size.
Source§

impl<T, U> UpcastableInto<U> for T
where U: UpcastableFrom<T>,

Source§

fn upcast(self) -> U

Call W::upcast_from(self)
Source§

impl<T, U> UpcastableInto<U> for T
where U: UpcastableFrom<T>,

Source§

fn upcast(self) -> U

Call W::upcast_from(self)
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,