@@ -5,7 +5,7 @@ use nohash_hasher::IntMap;
5
5
use crate :: {
6
6
ArchetypeFieldName , ArchetypeName , Component , ComponentDescriptor , SerializedComponentBatch ,
7
7
} ;
8
- use re_types_core:: { try_serialize_field, ComponentName } ;
8
+ use re_types_core:: { try_serialize_field, ComponentName , Loggable } ;
9
9
10
10
const DEFAULT_ARCHETYPE_NAME : & str = "rerun.AnyValues" ;
11
11
const DEFAULT_COMPONENT_NAME : & str = "rerun.component.AnyValue" ;
@@ -43,14 +43,14 @@ impl AnyValues {
43
43
archetype_field_name : impl Into < ArchetypeFieldName > ,
44
44
array : arrow:: array:: ArrayRef ,
45
45
) -> Self {
46
- self . field_with_name ( archetype_field_name, DEFAULT_COMPONENT_NAME , array)
46
+ self . field_with_component_name ( archetype_field_name, DEFAULT_COMPONENT_NAME , array)
47
47
}
48
48
49
49
/// Adds a field of arbitrary data to this archetype.
50
50
///
51
51
/// In many cases, it might be more convenient to use [`Self::component`] to log an existing Rerun component instead.
52
52
#[ inline]
53
- pub fn field_with_name (
53
+ pub fn field_with_component_name (
54
54
mut self ,
55
55
archetype_field_name : impl Into < ArchetypeFieldName > ,
56
56
component_name : impl Into < ComponentName > ,
@@ -78,18 +78,18 @@ impl AnyValues {
78
78
archetype_field_name : impl Into < ArchetypeFieldName > ,
79
79
component : impl IntoIterator < Item = impl Into < C > > ,
80
80
) -> Self {
81
- self . component_with_name ( archetype_field_name, C :: name ( ) , component)
81
+ self . loggable ( archetype_field_name, C :: name ( ) , component)
82
82
}
83
83
84
84
/// Adds an existing Rerun [`Component`](crate::Component) to this archetype.
85
85
///
86
86
/// This method can be used to override the component name.
87
87
#[ inline]
88
- pub fn component_with_name < C : Component > (
88
+ pub fn loggable < L : Loggable > (
89
89
mut self ,
90
90
archetype_field_name : impl Into < ArchetypeFieldName > ,
91
91
component_name : impl Into < ComponentName > ,
92
- component : impl IntoIterator < Item = impl Into < C > > ,
92
+ component : impl IntoIterator < Item = impl Into < L > > ,
93
93
) -> Self {
94
94
let archetype_field_name = archetype_field_name. into ( ) ;
95
95
try_serialize_field (
@@ -117,16 +117,12 @@ mod test {
117
117
fn simple ( ) {
118
118
let _ = AnyValues :: default ( )
119
119
. component :: < components:: Scalar > ( "confidence" , [ 1.2f64 , 3.4 , 5.6 ] )
120
- . component_with_name :: < components:: Text > (
121
- "homepage" ,
122
- "user.url" ,
123
- vec ! [ "https://www.rerun.io" ] ,
124
- )
120
+ . loggable :: < components:: Text > ( "homepage" , "user.url" , vec ! [ "https://www.rerun.io" ] )
125
121
. field (
126
122
"description" ,
127
123
Arc :: new ( arrow:: array:: StringArray :: from ( vec ! [ "Bla bla bla…" ] ) ) ,
128
124
)
129
- . field_with_name (
125
+ . field_with_component_name (
130
126
"repository" ,
131
127
"user.git" ,
132
128
Arc :: new ( arrow:: array:: StringArray :: from ( vec ! [
0 commit comments