pub struct Graphics<'a, T>where
T: RequestDraw<'a> + Canvas,{ /* private fields */ }Implementations§
Source§impl<'a, T: RequestDraw<'a> + Canvas> Graphics<'a, T>
impl<'a, T: RequestDraw<'a> + Canvas> Graphics<'a, T>
Sourcepub fn create(canvas: &'a mut T) -> Result<Self, String>
pub fn create(canvas: &'a mut T) -> Result<Self, String>
Examples found in repository?
examples/shapes.rs (line 60)
47fn main() -> Result<(), String> {
48 let antialiasing = false;
49 let antialiasing_resolution = 1;
50 let fill_color = Some(color::BLACK);
51
52 let mut canvas = SimpleCanvas::new(
53 WIDTH as usize,
54 HEIGHT as usize,
55 fill_color,
56 antialiasing,
57 antialiasing_resolution,
58 );
59
60 let mut graphics = Graphics::create(&mut canvas)?;
61 graphics.run(&mut ShapesHandler {})?;
62
63 Ok(())
64}More examples
examples/points_cloud.rs (line 74)
61fn main() -> Result<(), String> {
62 let antialiasing = false;
63 let antialiasing_resolution = 1;
64 let fill_color = Some(color::BLACK);
65
66 let mut canvas = SimpleCanvas::new(
67 WIDTH as usize,
68 HEIGHT as usize,
69 fill_color,
70 antialiasing,
71 antialiasing_resolution,
72 );
73
74 let mut graphics = Graphics::create(&mut canvas)?;
75 graphics.run(&mut PointsCloudSample {
76 point_cloud: create_point_cloud(),
77 })?;
78
79 Ok(())
80}Sourcepub fn run<G: CanvasHandler>(&mut self, handler: &mut G) -> Result<(), String>
pub fn run<G: CanvasHandler>(&mut self, handler: &mut G) -> Result<(), String>
Examples found in repository?
examples/shapes.rs (line 61)
47fn main() -> Result<(), String> {
48 let antialiasing = false;
49 let antialiasing_resolution = 1;
50 let fill_color = Some(color::BLACK);
51
52 let mut canvas = SimpleCanvas::new(
53 WIDTH as usize,
54 HEIGHT as usize,
55 fill_color,
56 antialiasing,
57 antialiasing_resolution,
58 );
59
60 let mut graphics = Graphics::create(&mut canvas)?;
61 graphics.run(&mut ShapesHandler {})?;
62
63 Ok(())
64}More examples
examples/points_cloud.rs (lines 75-77)
61fn main() -> Result<(), String> {
62 let antialiasing = false;
63 let antialiasing_resolution = 1;
64 let fill_color = Some(color::BLACK);
65
66 let mut canvas = SimpleCanvas::new(
67 WIDTH as usize,
68 HEIGHT as usize,
69 fill_color,
70 antialiasing,
71 antialiasing_resolution,
72 );
73
74 let mut graphics = Graphics::create(&mut canvas)?;
75 graphics.run(&mut PointsCloudSample {
76 point_cloud: create_point_cloud(),
77 })?;
78
79 Ok(())
80}Trait Implementations§
Source§impl<'a, T: RequestDraw<'a> + Canvas> HandlesDrawRequest for Graphics<'a, T>
impl<'a, T: RequestDraw<'a> + Canvas> HandlesDrawRequest for Graphics<'a, T>
impl<'a, T: RequestDraw<'a> + Canvas> Sync for Graphics<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for Graphics<'a, T>
impl<'a, T> !RefUnwindSafe for Graphics<'a, T>
impl<'a, T> Send for Graphics<'a, T>where
T: Send,
impl<'a, T> Unpin for Graphics<'a, T>
impl<'a, T> !UnwindSafe for Graphics<'a, T>
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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