error_boundary.rs 363 B

12345678910111213141516171819
  1. use std::cell::RefCell;
  2. use crate::ScopeId;
  3. /// A boundary that will capture any errors from child components
  4. #[allow(dead_code)]
  5. pub struct ErrorBoundary {
  6. error: RefCell<Option<ScopeId>>,
  7. id: ScopeId,
  8. }
  9. impl ErrorBoundary {
  10. pub fn new(id: ScopeId) -> Self {
  11. Self {
  12. error: RefCell::new(None),
  13. id,
  14. }
  15. }
  16. }