StackOverflow Questions for Tag: trait-objects

Jared Dewey
Jared Dewey

Reputation: 31

Generic Trait Parameters in Rust

Score: 3

Views: 54

Answers: 1

Read More
Ethan Teng
Ethan Teng

Reputation: 41

How can I create a Trait to represent all the type of data, except std::Any

Score: 3

Views: 72

Answers: 1

Read More
foehn
foehn

Reputation: 467

How to handle BufReader<File> and BufReader<Stdin> without dynamic dispatch?

Score: 1

Views: 84

Answers: 1

Read More
Divyansh
Divyansh

Reputation: 67

Is there any way to use Associated Function of a trait in Rust?

Score: 1

Views: 142

Answers: 1

Read More
sundegan
sundegan

Reputation: 23

Why are trait objects usually used via references (&dyn Trait) or smart Pointers (like Box<dyn Trait>)?

Score: 0

Views: 134

Answers: 1

Read More
Code learner
Code learner

Reputation: 304

Understanding `impl dyn Trait`

Score: 1

Views: 1281

Answers: 1

Read More
Fred Hors
Fred Hors

Reputation: 4156

What does Rust error "you could box the found value and coerce it to the trait object" mean?

Score: -1

Views: 433

Answers: 1

Read More
GamefanA
GamefanA

Reputation: 1643

Understanding coercion of Box<Trait> to Box<dyn Trait>

Score: 0

Views: 25

Answers: 0

Read More
user3929076
user3929076

Reputation: 29

Why can't trait methods have a default implementation returning self as a trait object

Score: 0

Views: 85

Answers: 1

Read More
TheOperator
TheOperator

Reputation: 6506

Conditionally enable Rust API only for `T = dyn Trait` type arguments

Score: 0

Views: 51

Answers: 0

Read More
KillAndEat
KillAndEat

Reputation: 103

Why the lifetime of self differs from a lifetime of trait that was implemented by self?

Score: 0

Views: 53

Answers: 0

Read More
14159
14159

Reputation: 185

Size of types implementing a trait

Score: 0

Views: 70

Answers: 0

Read More
Terseus
Terseus

Reputation: 2212

Return Result<Box<dyn Trait>> in a match

Score: 5

Views: 1675

Answers: 2

Read More
felipetg
felipetg

Reputation: 1

How to implement a trait method that returns a trait object (of a different trait)

Score: 0

Views: 113

Answers: 0

Read More
Levente Bokor
Levente Bokor

Reputation: 80

how to store multiple instances of dyn Trait, where Trait has associated types?

Score: 0

Views: 262

Answers: 1

Read More
E Y
E Y

Reputation: 443

Lifetime mismatch between function in async trait and implementations

Score: 1

Views: 726

Answers: 0

Read More
Ismaïl Mourtada
Ismaïl Mourtada

Reputation: 472

Attempt to create generic queries with Diesel - "first" method with incomplete trait bounds

Score: 0

Views: 45

Answers: 0

Read More
RBF06
RBF06

Reputation: 2419

What are the rules for coercing values to trait objects?

Score: 4

Views: 518

Answers: 2

Read More
bluenote10
bluenote10

Reputation: 26710

Is static dispatch "almost always" faster than boxed dyn trait dispatch?

Score: 4

Views: 1624

Answers: 0

Read More
Simin Xiong
Simin Xiong

Reputation: 45

Why doesn't Rust support trait objects with associated constants?

Score: 3

Views: 1221

Answers: 3

Read More
PreviousPage 1Next