pub struct MethodProfile { /* private fields */ }Expand description
Immutable per-method metadata used to build feature vectors.
The profile stores the inputs called for by the design document: accessed fields, signature types, local-variable types, external domains, and the method name itself.
§Examples
use whitaker_common::decomposition_advice::MethodProfileBuilder;
let mut builder = MethodProfileBuilder::new("parse_tokens");
builder
.record_accessed_field("grammar")
.record_accessed_field("tokens")
.record_signature_type("TokenStream");
let profile = builder.build();
assert_eq!(profile.name(), "parse_tokens");
assert_eq!(profile.accessed_fields().len(), 2);
assert_eq!(profile.signature_types().len(), 1);Implementations§
Source§impl MethodProfile
impl MethodProfile
Sourcepub fn accessed_fields(&self) -> &BTreeSet<String>
pub fn accessed_fields(&self) -> &BTreeSet<String>
Returns accessed fields.
Sourcepub fn signature_types(&self) -> &BTreeSet<String>
pub fn signature_types(&self) -> &BTreeSet<String>
Returns types used in the method signature.
Sourcepub fn local_types(&self) -> &BTreeSet<String>
pub fn local_types(&self) -> &BTreeSet<String>
Returns types used in local variables.
Sourcepub fn external_domains(&self) -> &BTreeSet<String>
pub fn external_domains(&self) -> &BTreeSet<String>
Returns external domains used by the method.
Trait Implementations§
Source§impl Clone for MethodProfile
impl Clone for MethodProfile
Source§fn clone(&self) -> MethodProfile
fn clone(&self) -> MethodProfile
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MethodProfile
impl Debug for MethodProfile
impl Eq for MethodProfile
Source§impl PartialEq for MethodProfile
impl PartialEq for MethodProfile
impl StructuralPartialEq for MethodProfile
Auto Trait Implementations§
impl Freeze for MethodProfile
impl RefUnwindSafe for MethodProfile
impl Send for MethodProfile
impl Sync for MethodProfile
impl Unpin for MethodProfile
impl UnsafeUnpin for MethodProfile
impl UnwindSafe for MethodProfile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more